mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
22 lines
326 B
Plaintext
22 lines
326 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')>
|
|
<p if(state.error)>
|
|
FATAL ERROR
|
|
</p>
|
|
</form>
|