mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
19 lines
291 B
Plaintext
19 lines
291 B
Plaintext
class {
|
|
onCreate() {
|
|
this.state = { test: true };
|
|
}
|
|
toggleTest() {
|
|
this.state.test = !this.state.test;
|
|
}
|
|
}
|
|
|
|
$ {
|
|
const attrs = {};
|
|
if(state.test) {
|
|
attrs.href = "https://example.com"
|
|
} else {
|
|
attrs["aria-disabled"] = true
|
|
}
|
|
}
|
|
|
|
<a ...attrs>some text</a> |