Skip to content

支持展现配置 #6

@jinzhubaofu

Description

@jinzhubaofu

基于 json-schema 生成表单是足够的,但是不是非常充分;尤其是在展现方面:

[ ] 1. Objectproperties 的排序干预
[ ] 2. 特殊展现的控件,比如密码类型文本输入框
[ ] 3. 以及其他

因此,需要引入一个额外的配置文件 uiSchema

基于格式:

{
  "$order": ["username", "password"],
  "password": {
    "$control": "password"
  },
  "username": {
    "$disabled": true
  },
  "address": {
    "$readOnly": true
  },
  "hiddenField": {
     "$hidden": true 
  }
}

其中,以 schema 的 value 值为主体;以 @ 开头的字段是给 uiSchema 使用的,非以 @ 开头的字段是 json-pointer 的一部分;

具体的:

  1. $order 只在 object 类型字段上生效,用以描述 object 属性展现的顺序
  2. $control 指定输入控件的渲染组件
  3. $disabled 整个字段的进入 禁用 状态
  4. $readOnly 整个字段进入 只读 状态
  5. $hidden 整个字段进入 隐藏 状态

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions