2020-07-28 10:03:53 +08:00
|
|
|
---
|
|
|
|
title: Switch 开关
|
2021-01-07 23:35:03 +08:00
|
|
|
description:
|
2020-07-28 10:03:53 +08:00
|
|
|
type: 0
|
|
|
|
group: ⚙ 组件
|
|
|
|
menuName: Switch
|
2021-01-07 23:35:03 +08:00
|
|
|
icon:
|
2020-07-28 10:03:53 +08:00
|
|
|
order: 66
|
|
|
|
---
|
2021-01-07 23:35:03 +08:00
|
|
|
|
2020-07-28 10:03:53 +08:00
|
|
|
## 基本用法
|
|
|
|
|
2021-01-07 23:35:03 +08:00
|
|
|
```schema
|
2020-07-28 10:03:53 +08:00
|
|
|
{
|
|
|
|
"type": "page",
|
|
|
|
"body": {
|
|
|
|
"type": "switch",
|
|
|
|
"value": true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2021-03-14 16:07:37 +08:00
|
|
|
这仅用于查看,表单中的请参考[这里](form/switch)
|
|
|
|
|
|
|
|
## 属性表
|
|
|
|
|
2020-07-28 10:03:53 +08:00
|
|
|
| 属性名 | 类型 | 默认值 | 说明 |
|
|
|
|
| --------- | -------- | ------ | ------------------------------- |
|
|
|
|
| type | `string` | | `"switch"` 指定为 Dialog 渲染器 |
|
|
|
|
| className | `string` | | 外层 Dom 的类名 |
|
|
|
|
| trueValue | any | | 真值,当值为该值时,开关开启 |
|
|
|
|
| option | `string` | | 右侧选项文本 |
|