UNPKG

simple-marko-ui

Version:

A simple library of UI components for MarkoJS.

24 lines (19 loc) 486 B
const Base = require("./base.mixin"); class Component { onCreate(input) { this.state = { value: input.value||null } } selectOption(event) { this.state.value = event.target.value; this.emit('input', {value: this.state.value, event: event}); } onInput(input) { if(input.value) { this.state.value = input.value; } } }; Object.assign(Component.prototype, Base); module.exports = Component;