[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

@@ -26,7 +26,7 @@ export default {
name: '黄龙万科中心',
address: '杭州市西湖区'
}, {
name: '黄龙万科中心H座'
name: '黄龙万科中心G座'
}, {
name: '黄龙万科中心H座',
address: '杭州市西湖区'
@@ -34,12 +34,12 @@ export default {
},
'en-US': {
searchResult: [{
name: 'Name',
name: 'Name1',
address: 'Address'
}, {
name: 'Name'
name: 'Name2'
}, {
name: 'Name',
name: 'Name3',
address: 'Address'
}]
}

View File

@@ -13,7 +13,7 @@
</demo-block>
<demo-block :title="$t('advancedUsage')">
<van-switch :value="checked2" @input="onInput" />
<van-switch :value="checked2" size="36px" @input="onInput" />
</demo-block>
</demo-section>
</template>

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