Vue.js toggle/switch button.

Install

npm install vue-js-toggle-button --save

Import plugin:

import ToggleButton from 'vue-js-toggle-button'
 
Vue.use(ToggleButton)

OR

OR

Import component:

import { ToggleButton } from 'vue-js-toggle-button'
 
Vue.component('ToggleButton', ToggleButton)

Use

<toggle-button @change="onChangeEventHandler"/>
 
<toggle-button v-model="myDataVariable"/>
 
<toggle-button :value="false"
               color="#82C7EB"
               :sync="true"
               :labels="true"/>
 
<toggle-button :value="true"
               :labels="{checked: 'Foo', unchecked: 'Bar'}"/>

Leave a comment

Your email address will not be published. Required fields are marked *