mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
21 lines
331 B
Plaintext
21 lines
331 B
Plaintext
class {
|
|
onInput(input) {
|
|
this.state = {
|
|
error: null
|
|
};
|
|
}
|
|
|
|
submit() {
|
|
var self = this;
|
|
|
|
setTimeout(function() {
|
|
self.state.error = "FATAL ERROR";
|
|
}, 50);
|
|
}
|
|
}
|
|
|
|
<form on-submit("submit")>
|
|
<if(state.error)>
|
|
<p>FATAL ERROR</p>
|
|
</if>
|
|
</form> |