1.0.9 • Published 5 years ago

vue-multi-toggle-switch v1.0.9

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

vue-multi-toggle-switch version vue

Toggle switch for vue.js

Do you have questions or want a new feature? Use the "Issues" section :point_left:

Setup

install:

npm install vue-multi-toggle-switch --save

Import: (in your main.js)

	import ToggleSwitch from "vue-multi-toggle-switch";
	import Vue from "vue";
	Vue.use(ToggleSwitch);

Usage

Use: (in your local .vue file/component, html section)

<toggle-switch 
  :resultData="resultData" //toggle switch button data
  :curStyle="curStyle" //toggle switch button css style
  @changeSwitch="change" //toggle switch button events
>
</toggle-switch>

Webpack project by vue-cli

https://github.com/woollay/vue-toggle-switch

Properties

NameTypeRequiredSampleDescription
resultDataJSONYes{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
curStyleJSONNo{ switch_on: "red" }customization style of toggle-switch

Events

NameDescription
changeSwitchTriggered 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

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago