【发布时间】:2017-02-11 08:10:01
【问题描述】:
我正在尝试使用 Mozilla 的 react-jsonschema form。
我的 jsonschema 为
{
"definitions": {
"address": {
"type": "object",
"properties": {
"street_address": {
"type": "string"
},
"city": {
"type": "string"
},
"state": {
"type": "string"
}
},
"required": [
"street_address",
"city",
"state"
]
},
"node": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/node"
}
}
}
}
},
"type": "object",
"properties": {
"billing_address": {
"title": "Billing address",
"$ref": "#/definitions/address"
},
"shipping_address": {
"title": "Shipping address",
"$ref": "#/definitions/address"
},
"tree": {
"title": "Recursive references",
"$ref": "#/definitions/node"
}
}
}
UiSchema 为
{
"ui:order": [
"shipping_address",
"billing_address",
"tree"
]
}
使用 reorder 我可以控制 ui 上控件的顺序,但由于送货地址有街道地址、城市和州。如何控制这些控件的 ui:order,考虑我希望城市首先出现在送货地址中,我该如何使用 Mozilla React jsonschema 表单来做到这一点。
【问题讨论】:
标签: javascript reactjs jsonschema