stateful components now work
This commit is contained in:
parent
f0e2d41fde
commit
be4159fc11
2 changed files with 55 additions and 40 deletions
|
|
@ -6,7 +6,7 @@ var
|
|||
|
||||
proc carousel*(key: VKey): VNode {.component.} =
|
||||
state:
|
||||
var counter = 0
|
||||
var counter: int = 0
|
||||
|
||||
proc next(ev: Event; n: VNode) =
|
||||
counter = (counter + 1) mod images.len
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue