simplest custom checkbox possible for vue
npm install vue-chkbash
npm install vue-chk
`
Yarn:
`bash
yarn vue-chk
`
Vue-Chk
$3
Globally:
`javascript
import chk from 'vue-chk'
Vue.component('vue-chk', chk)
`
or inside component:
`javascript
import VueChk from 'vue-chk'
export default {
components: {
'vue-chk': VueChk
}
}
`
Asynchronously:
`javascript
export default {
components: {
'vue-chk': () => import('vue-chk')
}
}
`
After that:
`html
Check me
`
#### Property
v-model: Boolean, Date, String, Number
Vue-Chk-List
$3
Globally:
`javascript
import { CheckboxList } from 'vue-chk'
Vue.component('vue-chk-list', CheckboxList)
`
or inside component:
`javascript
import { CheckboxList } from 'vue-chk'
export default {
components: {
'vue-chk-list': CheckboxList
}
}
`
After that:
`html
{{ item.label }}
`
#### Properties
- v-model: Array object where all checked items are saved
- list: Array object with its items to be showed
#### Slot
The list offers the possibility to customize what will be shown, its slot is named item--slot with its scope representing an item inside the list property
`html
{{ item.label }}
`
API
@input` (totally optional): Triggers when checkbox is clicked