Skip to content

Commit a0dd581

Browse files
Add checkbox demo
1 parent a974ae6 commit a0dd581

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
12 KB
Binary file not shown.

components/app-checkbox/demo.marko

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1+
class {
2+
onInput() {
3+
this.state = { checked: true };
4+
}
5+
6+
handleCheckboxToggle() {
7+
this.state.checked = !this.state.checked;
8+
}
9+
}
10+
11+
<h1>Is checked: ${state.checked}</h1>
112
<app-checkbox
213
label="Foo"
314
data={name: 'foo'}
4-
checked=state.checked.foo
15+
checked=state.checked
516
onToggle("handleCheckboxToggle")/>
17+

0 commit comments

Comments
 (0)