# switch

# Schema类静态属性

Schema类静态属性请访问 Schema.js类静态属性值逻辑与事件逻辑关系

{
  widget: 'switch',
  title: '开关',
  preview: '',
  type: 'boolean',
  validators: [],
  logic: {
    value: ['=', '!='],
    event: []
  }
}
1
2
3
4
5
6
7
8
9
10
11

# schema.default

默认false

# schema.option定义

schema完整定义请访问schema

{
  "open": "开",  // 选中时的内容
  "close": "关"  // 非选中时的内容
}
1
2
3
4

# 示例展示

  • schema
{
  "key": "k0CyR07yT",
  "widget": "switch",
  "hidden": false,
  "option": {
    "open": "是",
    "close": "否"
  },
  "name": "disabled",
  "type": "boolean",
  "label": "是否禁用",
  "description": "",
  "help": "",
  "disabled": false,
  "rules": [
    {
      "required": false,
      "message": "必填",
      "type": "boolean",
      "trigger": "change"
    }
  ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
更新: 3/22/2021, 6:03:54 PM