UNPKG

vuikit

Version:

A Vuejs component library based on UIkit

32 lines (28 loc) 585 B
/** * Vuikit 0.7.0 * (c) 2018 Miljan Aleksic * @license MIT */ import mergeData from 'vuikit/core/helpers/vue-data-merge' export default { functional: true, props: ['checked'], render (h, { data, props, listeners }) { const def = { staticClass: 'uk-checkbox', attrs: { type: 'checkbox' }, domProps: { checked: props.checked }, on: { change: e => { // ensures checked state consistency e.target.checked = props.checked } } } return h('input', mergeData(data, def)) } }