要求
我想在原理图中使用提示类型“确认”并基于“是”/“否”我想隐藏下一个问题。如下面的 schema.json 文件所示,有一个确认和一个多选值列表。如果用户选择“否”,我想隐藏该列表。如何实现?
架构.json
{
"$schema": "http://json-schema.org/schema",
"id": "Schemantics",
"title": "Generator",
"type": "object",
"properties": {
"confirmation": {
"description": "Folder location?",
"type": "string",
"x-prompt": {
"message": "Would you like to select component?",
"type": "confirmation"
}
},
"components": {
"description": "Select components",
"type": "array",
"x-prompt": {
"message": "Select components",
"type": "list",
"multiselect": true,
"items": [
"HouseDetails",
"UserDetails",
"Uploads"
]
}
}
}
}
根据@jeroenouw 给出的评论,我尝试了下面的代码,但它仍然无法正常工作
{
"$schema": "http://json-schema.org/schema",
"id": "Schemantics",
"title": "Generator",
"type": "object",
"properties": {
"confirmation": {
"description": "Folder location?",
"type": "object",
"x-prompt": {
"message": "Would you like to select component?",
"type": "confirmation",
"items": {
"components": {
"description": "Select components",
"type": "array",
"x-prompt": {
"message": "Select components",
"type": "list",
"multiselect": true,
"items": [
"HouseDetails",
"UserDetails",
"Uploads"
]
}
}
}
}
}
}
}