simple-marko-ui
Version:
A simple library of UI components for MarkoJS.
29 lines (23 loc) • 580 B
JavaScript
const Base = require("./base.mixin");
class Component {
onCreate(input) {
this.state = {
value: input.value||null
}
}
pushInput(event) {
this.state.value = event.target.value;
this.input.value = this.state.value;
event.value = event.target.value;
this.handleInput(event);
}
getValue() {
return this.state.value;
}
setValue(value) {
this.state.value = value;
this.input.value = value;
}
};
Object.assign(Component.prototype, Base);
module.exports = Component;