vue-multi-toggle-switch
Toggle switch for vue.js
Do you have questions or want a new feature? Use the "Issues" section 👈
Setup
install:
npm install vue-multi-toggle-switch --save
Import: (in your main.js)
; ; Vue;
Usage
Use: (in your local .vue file/component, html section)
Webpack project by vue-cli
https://github.com/woollay/vue-toggle-switch
Properties
Name | Type | Required | Sample | Description |
---|---|---|---|---|
resultData | JSON | Yes | [{id: "234",status: false,on: "ON",off: "OFF"}] | id:id of toggle-switch; on/off status of toggle-switch; on:the text of on status in toggle-switch; off:the text of off status in toggle-switch |
curStyle | JSON | No | { switch_on: "red" } | customization style of toggle-switch |
Events
Name | Description |
---|---|
changeSwitch | Triggered on toggle, user selects switch option, returns current value. used in component,like: @changeSwitch="change", the callback function as following: function change(result) { console.log("option changed:" + result.id + "," + result.checked); } |
LICENSE
MIT