[Improvement] Switch: support custom size (#723)

This commit is contained in:
neverland
2018-03-19 13:44:12 +08:00
committed by GitHub
parent 1489efd9f9
commit c6a3896ce7
9 changed files with 62 additions and 63 deletions

View File

@@ -41,7 +41,7 @@ export default {
#### Advanced usage
```html
<van-switch :value="checked" @input="onInput" />
<van-switch :value="checked" size="36px" @input="onInput" />
```
```js
@@ -71,7 +71,8 @@ export default {
|-----------|-----------|-----------|-------------|-------------|
| v-model | Check status of Switch | `Boolean` | `false` | - |
| loading | Whether to show loading icon | `Boolean` | `false` | - |
| disabled | Disable switch | `Boolean` | `false` | - |
| disabled | Whether to disable switch | `Boolean` | `false` | - |
| size | Size of switch | `String` | `30px` | - |
### Event

View File

@@ -36,7 +36,7 @@ export default {
#### 高级用法
```html
<van-switch :value="checked" @input="onInput" />
<van-switch :value="checked" size="36px" @input="onInput" />
```
```js
@@ -68,6 +68,7 @@ export default {
| v-model | 开关选中状态 | `Boolean` | `false` | - |
| loading | 是否为加载状态 | `Boolean` | `false` | - |
| disabled | 是否为禁用状态 | `Boolean` | `false` | - |
| size | 开关尺寸 | `String` | `30px` | - |
### Event