0.0.1 • Published 6 years ago

vue-switch-elsewares v0.0.1

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

vue-switch-elsewares

A switch component for Vue 2 based on dai-siki's work.

demo

click me.

Env

vue.js + webpack + es6 + scss

install

npm

$ npm install vue-switch-elsewares

Usage

Attributes

名称类型默认说明
valuetwoWay要绑定的变量
open-valuetrue激活时绑定值
close-valuefalse关闭时绑定值
open-nameString"是"激活时显示文字
close-nameString"否"关闭时显示文字
sizeString"md"sm lg
colorString"red"red/blue/orange/green
disabledBolleanfalseas u know

Example (vue@2.0+)

<div id="app">
	<label for="myDate">Truthiness?</label>
	<div class="wrap">
		<my-switch size="xl" on-label="foo" off-label="bar" on-value="" off-value="" v-model="toggle"></my-switch>
	</div>
</div>

<script>
	import 'babel-polyfill';
	import Vue from 'vue';
	import mySwitch from 'vue-switch/switch-2.vue';

	new Vue({
		el: '#app',
		data: {
			toggle: true
		},
		components: {
			'my-switch': mySwitch
		}
	});
</script>