mirror of
https://github.com/youzan/vant.git
synced 2026-05-08 01:07:46 +08:00
@@ -1,6 +1,6 @@
|
||||
## SwitchCell
|
||||
|
||||
`SwitchCell`组件是对`Switch`和`Cell`组件的封装
|
||||
`SwitchCell` component is an encapsulation of `Switch` and `Cell`.
|
||||
|
||||
<script>
|
||||
export default {
|
||||
@@ -42,9 +42,9 @@ export default {
|
||||
:::
|
||||
|
||||
#### Disabled
|
||||
通过`disabled`属性可以将组件设置为禁用状态
|
||||
use `disabled` property to disable the component
|
||||
|
||||
:::demo 禁用状态
|
||||
:::demo Disabled component
|
||||
```html
|
||||
<van-cell-group>
|
||||
<van-switch-cell v-model="checked" :disabled="true" title="标题" />
|
||||
@@ -53,9 +53,9 @@ export default {
|
||||
:::
|
||||
|
||||
#### Loading
|
||||
通过`loading`属性可以将组件设置为加载状态
|
||||
use `loading` property to keep component in loading state
|
||||
|
||||
:::demo 加载状态
|
||||
:::demo Component in loading
|
||||
```html
|
||||
<van-cell-group>
|
||||
<van-switch-cell v-model="checked" :loading="true" title="标题" />
|
||||
@@ -67,13 +67,13 @@ export default {
|
||||
|
||||
| Attribute | Description | Type | Default | Accepted Values |
|
||||
|-----------|-----------|-----------|-------------|-------------|
|
||||
| v-model | 开关状态 | `Boolean` | - | - |
|
||||
| title | 左侧标题 | `String` | `''` | - |
|
||||
| loading | 是否为加载状态 | `Boolean` | `false` | - |
|
||||
| disabled | 是否为禁用状态 | `Boolean` | `false` | - |
|
||||
| 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` | - |
|
||||
|
||||
### Event
|
||||
|
||||
| Event | Description | Attribute |
|
||||
|-----------|-----------|-----------|
|
||||
| change | 开关状态切换回调 | checked: 是否选中开关 |
|
||||
| change | triggered when the on-off state is changed | checked: switch is on or not |
|
||||
Reference in New Issue
Block a user