【问题标题】:Angular Schema form - Override the input type of a fieldAngular Schema 表单 - 覆盖字段的输入类型
【发布时间】:2016-08-30 21:44:09
【问题描述】:

考虑架构

{
  "type": "object",
  "title": "Comment",
  "properties": {
    "name": {
      "title": "Name",
      "type": "string"
    },
    "gender":{
        "title":"Gender",
        "type":"string",
        "enum":["m","f"]
    },
    "comment": {
      "title": "Comment",
      "type": "string",
      "maxLength": 20,
      "validationMessage": "Don't be greedy!"
    }
  },
  "required": [
    "name",
    "email",
    "comment"
  ]
}

如何在不使用x-schema-form 属性,并且不重写表单的整个字段(使用“*”并仅更改必填字段)。我尝试了以下表单定义,但字段重复。

[
  "*",
  {
      "key":"gender",
      "type":"text"
  },
  {
    "type": "submit",
    "style": "btn-info",
    "title": "OK"
  }
]

上面的定义将显示两个gender 字段,一个是select 类型,另一个是text 类型。我的要求是只显示 text 类型的一个 gender,其中显示 select 类型的 gender。 p>

【问题讨论】:

    标签: angularjs angular-schema-form


    【解决方案1】:

    v1.0.0-alpha.1 开始,已添加使用键“...”的功能,以允许在表单定义中添加剩余的未定义架构属性键。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多