Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
ボタンを押したときに反映するように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
jiro4989 committed Nov 22, 2019
1 parent 05b81c5 commit 6a70917
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/index.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ const
]

var
user, repo: string
branch = "master"
user, userBuf, repo, repoBuf: string
branchBuf = "master"
branch = branchBuf

proc editUser(ev: Event; n: VNode) =
user = $n.value
userBuf = $n.value

proc editRepo(ev: Event; n: VNode) =
repo = $n.value
repoBuf = $n.value

proc editBranch(ev: Event; n: VNode) =
branch = $n.value
branchBuf = $n.value

proc createDom(): VNode =
result = buildHtml(tdiv):
Expand All @@ -53,7 +54,9 @@ proc createDom(): VNode =
button(class = "waves-effect waves-light btn"):
text "Show"
proc onclick(ev: Event, n: VNode) =
echo "Clicked"
user = userBuf
repo = repoBuf
branch = branchBuf
hr()
tdiv:
h2: text "Output"
Expand Down

0 comments on commit 6a70917

Please sign in to comment.