server side Karax rendering: show how events can be handled
This commit is contained in:
parent
50bed1f6e9
commit
20fe35355c
1 changed files with 7 additions and 0 deletions
|
|
@ -5,6 +5,10 @@ import "../karax" / [karaxdsl, vdom]
|
|||
when defined(js):
|
||||
{.error: "Use 'nim c' to compile this example".}
|
||||
|
||||
template kxi(): int = 0
|
||||
template addEventHandler(n: VNode; k: EventKind; action: string; kxi: int) =
|
||||
n.setAttr($k, action)
|
||||
|
||||
let tab = buildHtml(table):
|
||||
tr:
|
||||
td:
|
||||
|
|
@ -16,5 +20,8 @@ let tab = buildHtml(table):
|
|||
text "Cell C"
|
||||
td:
|
||||
text "Cell D"
|
||||
td:
|
||||
a(href = "#/", onclick = "javascript:myFunc()"):
|
||||
text"haha"
|
||||
|
||||
echo tab
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue