nfp_sites/filadelfia_web/app/input.js

20 lines
409 B
JavaScript
Raw Normal View History

2023-11-14 07:27:04 +00:00
const m = require('mithril')
const Input = {
oninit: function(vnode) {
},
view: function(vnode) {
return [
m('label', vnode.attrs.label),
m('input', {
type: vnode.attrs.type || 'text',
value: vnode.attrs.form[vnode.attrs.formKey],
oninput: (e) => { vnode.attrs.form[vnode.attrs.formKey] = e.currentTarget.value },
}),
]
},
}
module.exports = Input