[Improvement] SwitchCell: add size prop (#1371)

This commit is contained in:
neverland 2018-07-01 07:47:14 +08:00 committed by GitHub
parent e820e072e3
commit e25dde299a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 8 deletions

View File

@ -93,7 +93,7 @@ exports[`renders demo correctly 1`] = `
<!---->
</div>
<div class="van-cell__value">
<div title="设为默认收货地址" class="van-switch" style="font-size:30px;">
<div title="设为默认收货地址" class="van-switch" style="font-size:26px;">
<div class="van-switch__node">
<!---->
</div>

View File

@ -188,7 +188,7 @@ exports[`create a AddressEdit with props 1`] = `
<!---->
</div>
<div class="van-cell__value">
<div title="设为默认收货地址" class="van-switch van-switch--on" style="font-size:30px;">
<div title="设为默认收货地址" class="van-switch van-switch--on" style="font-size:26px;">
<div class="van-switch__node">
<!---->
</div>

View File

@ -54,8 +54,9 @@ use `loading` property to keep component in loading state
|-----------|-----------|-----------|-------------|
| v-model | on-off state of the switch | `Boolean` | - |
| title | the leftside title | `String` | `''` |
| loading | whether the component is in loading state | `Boolean` | `false` |
| disabled | whether to disable the component | `Boolean` | `false` |
| loading | whether switch is loading | `Boolean` | `false` |
| disabled | whether to disable switch | `Boolean` | `false` |
| size | Size of switch | `String` | `26px` |
### Event

View File

@ -20,7 +20,11 @@ export default create({
value: Boolean,
border: Boolean,
loading: Boolean,
disabled: Boolean
disabled: Boolean,
size: {
type: String,
default: '26px'
}
},
watch: {

View File

@ -10,7 +10,7 @@ exports[`renders demo correctly 1`] = `
<!---->
</div>
<div class="van-cell__value">
<div title="标题" class="van-switch van-switch--on" style="font-size:30px;">
<div title="标题" class="van-switch van-switch--on" style="font-size:26px;">
<div class="van-switch__node">
<!---->
</div>
@ -28,7 +28,7 @@ exports[`renders demo correctly 1`] = `
<!---->
</div>
<div class="van-cell__value">
<div title="标题" class="van-switch van-switch--on van-switch--disabled" style="font-size:30px;">
<div title="标题" class="van-switch van-switch--on van-switch--disabled" style="font-size:26px;">
<div class="van-switch__node">
<!---->
</div>
@ -46,7 +46,7 @@ exports[`renders demo correctly 1`] = `
<!---->
</div>
<div class="van-cell__value">
<div title="标题" class="van-switch van-switch--on" style="font-size:30px;">
<div title="标题" class="van-switch van-switch--on" style="font-size:26px;">
<div class="van-switch__node">
<div class="van-loading van-loading--circular van-loading--black van-switch__loading"><span class="van-loading__spinner van-loading__spinner--circular"> <svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div>
</div>

View File

@ -56,6 +56,7 @@ export default {
| title | 左侧标题 | `String` | `''` |
| loading | 是否为加载状态 | `Boolean` | `false` |
| disabled | 是否为禁用状态 | `Boolean` | `false` |
| size | 开关尺寸 | `String` | `26px` |
### Event

View File

@ -1,6 +1,9 @@
@import './common/var.css';
.van-switch-cell {
padding-top: 8px;
padding-bottom: 8px;
.van-switch {
float: right;
}