1.0.5 • Published 4 years ago
shapla-checkbox v1.0.5
Shapla Checkbox
A custom checkbox for VueJS that exactly work same way as native checkbox
Table of contents
Installation
npm i shapla-checkbox
Usage
Add the component:
import shaplaCheckbox from 'shapla-checkbox';
export default {
name: 'Hello',
components: {
shaplaCheckbox
},
data(){
return {
singleCheckbox:false
}
}
}
<shapla-checkbox v-model="singleCheckbox">Label goes here.</shapla-checkbox>
Props
Property | Type | Required | Default | Description |
---|---|---|---|---|
label | String | no | | Checkbox label | |
value | String | no | on | The default value for the checkbox |
trueValue | String | no | true | The value when user checked the checkbox |
falseValue | String | no | false | The value when user unchecked the checkbox |
disabled | Boolean | no | false | If set true , Checkbox will be disabled to check. |
checked | Boolean | no | undefined | If set true , Checkbox will be checked. |
Listeners
The button component fires the following events:
change
: When checkbox is clicked, it fires the event.
<!-- template -->
<shapla-button @change="handleChange"></shapla-button>
<!-- method -->
methods: {
handleChange(newValue){
// Handle change event
}
}