【发布时间】:2018-05-30 16:53:01
【问题描述】:
我有这个架构:
{
"type": "object",
"title": "Comment",
"required": [
"comments"
],
"properties": {
"comments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"email": {
"title": "Email",
"type": "string",
"pattern": "^\\S+@\\S+$",
"description": "Email will be used for evil."
},
"spam": {
"title": "Spam",
"type": "boolean",
"default": true
},
"comment": {
"title": "Comment",
"type": "string",
"maxLength": 20,
"validationMessage": "Don't be greedy!"
}
},
"required": [
"name",
"comment"
]
}
}
}
}
这是一个 cmets 数组。我可以添加和删除 cmets。
如何在默认情况下始终渲染数组的 2 项?
我已尝试使用 maxItems 和 minItems,但这些参数不会呈现项目。
【问题讨论】:
标签: javascript angularjs angular-schema-form