mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
29 lines
437 B
JavaScript
29 lines
437 B
JavaScript
var Component = {
|
|
onCreate: function () {
|
|
this.logOutput = [];
|
|
this.state = { active: true };
|
|
},
|
|
|
|
log(data) {
|
|
this.logOutput.push(data);
|
|
},
|
|
|
|
clearLog() {
|
|
this.logOutput = [];
|
|
},
|
|
|
|
toggle() {
|
|
this.state.active = !this.state.active;
|
|
},
|
|
|
|
handleDOMClick: function () {
|
|
this.log("dom:click");
|
|
},
|
|
|
|
handleCustomClick: function () {
|
|
this.log("custom:click");
|
|
},
|
|
};
|
|
|
|
module.exports = Component;
|