Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持展现配置 #6

Open
jinzhubaofu opened this issue Nov 9, 2016 · 0 comments
Open

支持展现配置 #6

jinzhubaofu opened this issue Nov 9, 2016 · 0 comments

Comments

@jinzhubaofu
Copy link
Contributor

jinzhubaofu commented Nov 9, 2016

基于 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 整个字段进入 隐藏 状态
jinzhubaofu pushed a commit that referenced this issue Nov 9, 2016
jinzhubaofu added a commit that referenced this issue Mar 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant