vue-on-off

1.0.5 • Public • Published

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>

Package Sidebar

Install

npm i vue-on-off

Weekly Downloads

1

Version

1.0.5

License

ISC

Unpacked Size

4.52 kB

Total Files

4

Last publish

Collaborators

  • onefivefournine