<script>
	module.exports = {
		data() {
			return {
				switch1: false,
				switch2: false,
				switch3: false,
				switch4: false,
				disabled: true
			};
		}
	}
</script>

## Switch 开关
在两种状态间切换时用到的开关选择器。

### 引入

```javascript
import { pswitch } from '@58fe/p5';
```

### 默认
:::demo
```html
<pswitch v-model="switch1"></pswitch>
<script>
	module.exports = {
		data() {
			return {
				switch1: false
			};
		}
	}
</script>
```
:::

### 文字&尺寸
自定义文案内容，建议在两个字以上，设置size为large
:::demo
```html
<pswitch v-model="switch2" ontext="1" offtext="0"></pswitch><br/>
<pswitch v-model="switch3" ontext="ON" offtext="OFF" size="large"></pswitch>
<script>
	module.exports = {
		methods: {
		},
		data() {
			return {
				switch2: false,
				switch3: false
			};
		}
	}
</script>
```
:::

### 禁用
:::demo
```html
<pswitch v-model="switch4" disabled=disabled></pswitch><br/>
<script>
	module.exports = {
		methods: {
		},
		data() {
			return {
				switch4: false,
				disabled: true
			};
		}
	}
</script>
```
:::

### 参数

| 参数     | 说明         | 类型        | 可选值       | 默认值  |
| -------- | ------------ | ----------- | ------------ | ------- |
| value    | 当前是否选中，可支持v-model双向绑定数据 | Boolean     | true/false   | false   |
| ontext   | 开状态文案     | String        | —— | 开 |
| offtext  | 关状态文案     | String        | —— | 关 |
| size     | 尺寸          | String        | —— | —— |
| disabled | 是否禁用       | String        | —— | false |
| input  | 支持v-model回调函数    | Function        | —— | —— |
