onMount(node) { this.ui = UI(node, { select: 'select'}); this.ui.select[0].addEventListener('change', (e) => { this.setData({ selected: this.options[e.currentTarget.selectedIndex].label }); }); }
onMount(node) { this.ui = UI(node, { inputId: '#id' }); this.ui.inputId[0].addEventListener('input', (e) => { let val = e.currentTarget.value; if (val && !this.disabled) { this.updateFields(this.disabled = true); } else if (!val && this.disabled) { this.updateFields(this.disabled = false); } }); }
onMount(node) { this.ui = UI(node, { button: 'button' }); this.checked = this.getData().checked; this.ui.button[0].addEventListener('click', (e) => { this.checked = !this.checked; this.setData({ checked: this.checked, label: this.checked ? 'set unchecked' : 'set checked' }); }); }