mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-25 15:59:16 +08:00
[Improvement] SwitchCell: add size prop (#1371)
This commit is contained in:
parent
e820e072e3
commit
e25dde299a
@ -93,7 +93,7 @@ exports[`renders demo correctly 1`] = `
|
|||||||
<!---->
|
<!---->
|
||||||
</div>
|
</div>
|
||||||
<div class="van-cell__value">
|
<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 class="van-switch__node">
|
||||||
<!---->
|
<!---->
|
||||||
</div>
|
</div>
|
||||||
|
@ -188,7 +188,7 @@ exports[`create a AddressEdit with props 1`] = `
|
|||||||
<!---->
|
<!---->
|
||||||
</div>
|
</div>
|
||||||
<div class="van-cell__value">
|
<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-switch__node">
|
||||||
<!---->
|
<!---->
|
||||||
</div>
|
</div>
|
||||||
|
@ -54,8 +54,9 @@ use `loading` property to keep component in loading state
|
|||||||
|-----------|-----------|-----------|-------------|
|
|-----------|-----------|-----------|-------------|
|
||||||
| v-model | on-off state of the switch | `Boolean` | - |
|
| v-model | on-off state of the switch | `Boolean` | - |
|
||||||
| title | the leftside title | `String` | `''` |
|
| title | the leftside title | `String` | `''` |
|
||||||
| loading | whether the component is in loading state | `Boolean` | `false` |
|
| loading | whether switch is loading | `Boolean` | `false` |
|
||||||
| disabled | whether to disable the component | `Boolean` | `false` |
|
| disabled | whether to disable switch | `Boolean` | `false` |
|
||||||
|
| size | Size of switch | `String` | `26px` |
|
||||||
|
|
||||||
### Event
|
### Event
|
||||||
|
|
||||||
|
@ -20,7 +20,11 @@ export default create({
|
|||||||
value: Boolean,
|
value: Boolean,
|
||||||
border: Boolean,
|
border: Boolean,
|
||||||
loading: Boolean,
|
loading: Boolean,
|
||||||
disabled: Boolean
|
disabled: Boolean,
|
||||||
|
size: {
|
||||||
|
type: String,
|
||||||
|
default: '26px'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -10,7 +10,7 @@ exports[`renders demo correctly 1`] = `
|
|||||||
<!---->
|
<!---->
|
||||||
</div>
|
</div>
|
||||||
<div class="van-cell__value">
|
<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-switch__node">
|
||||||
<!---->
|
<!---->
|
||||||
</div>
|
</div>
|
||||||
@ -28,7 +28,7 @@ exports[`renders demo correctly 1`] = `
|
|||||||
<!---->
|
<!---->
|
||||||
</div>
|
</div>
|
||||||
<div class="van-cell__value">
|
<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 class="van-switch__node">
|
||||||
<!---->
|
<!---->
|
||||||
</div>
|
</div>
|
||||||
@ -46,7 +46,7 @@ exports[`renders demo correctly 1`] = `
|
|||||||
<!---->
|
<!---->
|
||||||
</div>
|
</div>
|
||||||
<div class="van-cell__value">
|
<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-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 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>
|
</div>
|
||||||
|
@ -56,6 +56,7 @@ export default {
|
|||||||
| title | 左侧标题 | `String` | `''` |
|
| title | 左侧标题 | `String` | `''` |
|
||||||
| loading | 是否为加载状态 | `Boolean` | `false` |
|
| loading | 是否为加载状态 | `Boolean` | `false` |
|
||||||
| disabled | 是否为禁用状态 | `Boolean` | `false` |
|
| disabled | 是否为禁用状态 | `Boolean` | `false` |
|
||||||
|
| size | 开关尺寸 | `String` | `26px` |
|
||||||
|
|
||||||
### Event
|
### Event
|
||||||
|
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
@import './common/var.css';
|
@import './common/var.css';
|
||||||
|
|
||||||
.van-switch-cell {
|
.van-switch-cell {
|
||||||
|
padding-top: 8px;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
|
||||||
.van-switch {
|
.van-switch {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user