Skip to content

Onefivefournine/vue-on-off

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue on-off switch component

Installation

npm i -s vue-on-off

Or...

yarn add vue-on-off

Or...

git clone https://github.com/Onefivefournine/vue-on-off.git

Usage

// register locally
import onOff from 'vue-on-off';

const app = new Vue({
  components: {
    onOff
  },
  data() {
    return {
      model: false
    };
  },
  methods: {
    modelChangeHandler() {
      /*
			* some API request or other actions,
			* you DON'T need to set model = !model
			*/
    }
  }
});

// OR register globally
Vue.component('onOff', onOff);
	<on-off v-model="model" :action="modelChangeHandler"></on-off>

About

Vue on-off switch component

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages