1

我正在使用角度模式形式。我遇到的问题是,当我尝试加载表单时,缺少一些必需的属性!该表格没有说明缺少的属性。但是,当我单击该特定字段并编辑某些内容然后将其删除时,它确实会为我突出显示该字段。我希望这也发生在初始加载时。寻找指针。谢谢

4

2 回答 2

0

您需要在表单配置架构中使用required属性:

//..other fields
"required": [
    "name",
    "email",
    "comment"
  ]

在这里查看演示,它也有必填字段:

{
  "type": "object",
  "title": "Comment",
  "properties": {
    "name":  {
      "title": "Name",
      "type": "string"
    },//here validation details
    "email":  {
      "title": "Email",
      "type": "string",
      "pattern": "^\\S+@\\S+$",
      "description": "Email will be used for evil."
    },
    "comment": {
      "title": "Comment",
      "type": "string",
      "maxLength": 20,
      "validationMessage": "Don't be greedy!"
    }
  },//here naming fields required
  "required": ["name","email","comment"]
}
于 2016-05-23T06:01:15.313 回答
0

该物业是validateOnRender: true

它需要添加到表单的全局选项对象中。

于 2017-07-18T07:04:29.087 回答