1.0.4 • Published 4 years ago
vue2-easy-controls v1.0.4
Vue Easy Controls
An easy to use Checkbox and Radio components for Vue 2
Installing
npm i vue2-easy-controls
OR
yarn add vue2-easy-controls
Usage
Registering components globally
import { EasyCheckbox, EasyRadio } from 'vue2-easy-controls'
Vue.use(EasyCheckbox)
Vue.use(EasyRadio)
Registering components locally
import { EasyCheckbox, EasyRadio } from 'vue2-easy-controls'
export default {
name: 'MyLocalComponent'
components: {
EasyCheckbox,
EasyRadio
}
}
Usage
data () {
return {
isChecked: false
}
}
<easy-checkbox text="Checkbox component" v-model="isChecked" />
OR
<easy-radio text="Radio component" v-model="isChecked" />
For more examples check here
NOTE: Props for both of the components are the same
Props
Prop | Type | Default |
---|---|---|
value | Any | |
checked | Boolean | false |
disabled | Boolean | false |
required | Boolean | false |
text | String | |
labelStyle | Object | { color (default: #3D4066), fontSize (default: '16px'), marginLeft (default: '8px'), marginRight : (default: '8px') } |
labelOnLeft | Boolean | false |
show | Boolean | true |
TODO:
- Make components more customizable (custom style, custom icons etc.)
- Make components more accessible
- Improve documentation by adding live examples
- Add switch component