mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 04:28:32 +08:00
203401cea6
* 修复 string2regExp 报错, 传入的时候先转成字符 * 修复 diffEditor 报错 * 修复 default filter 问题 * 修复文档链接错误 * feat:switch 支持配置开启和关闭状态下的文本 Co-authored-by: 2betop <2betop.cn@gmail.com>
33 lines
754 B
Markdown
Executable File
33 lines
754 B
Markdown
Executable File
---
|
|
title: Switch 开关
|
|
description:
|
|
type: 0
|
|
group: ⚙ 组件
|
|
menuName: Switch
|
|
icon:
|
|
order: 66
|
|
---
|
|
|
|
## 基本用法
|
|
|
|
```schema
|
|
{
|
|
"type": "page",
|
|
"body": {
|
|
"type": "switch",
|
|
"value": true
|
|
}
|
|
}
|
|
```
|
|
|
|
这仅用于查看,表单中的请参考[这里](form/switch)
|
|
|
|
## 属性表
|
|
|
|
| 属性名 | 类型 | 默认值 | 说明 |
|
|
| --------- | -------- | ------ | ------------------------------- |
|
|
| type | `string` | | `"switch"` 指定为 Dialog 渲染器 |
|
|
| className | `string` | | 外层 Dom 的类名 |
|
|
| trueValue | any | | 真值,当值为该值时,开关开启 |
|
|
| option | `string` | | 右侧选项文本 |
|