ember-octane - 基于 ember octane 中选择的答案的基于条件的显示部分
问题描述
我有一个带有多个部分的 JSON 数据,其中部分将在用户单击下一个按钮后显示。在这里我需要添加条件(例如:如果用户在第 1 部分中为问题选择“是”,在第 3 部分中我们将添加条件作为条件将有问题和值如果值为是并且对于相同的问题现在选择所有字段并单击下一个用户需要跳过第2节并向他显示第3节)。由于我对 ember octane 非常陌生,因此遇到了这个特殊问题
{
"deadline": "2020-10-02T09:30:13+05:30",
"formType": "One time",
"questions": [
{
"condition": {},
"questions": [
{
"type": "currency",
"options": [
""
],
"helpText": "",
"question": "How Many Products do you sell",
"required": false,
"indicator": "dfsff_0_0",
"responseType": "number"
},
{
"type": "boolean",
"options": [
""
],
"helpText": "",
"question": "Are you in profits",
"required": false,
"indicator": "dfsff_0_1",
},
{
"type": "dropdown",
"options": [
"sdsd",
"sdsdddsd"
],
"helpText": "",
"question": "dsds",
"required": false,
"indicator": "dfsff_0_2",
"responseType": ""
}
],
"sectionTitle": "section 1"
},
{
"condition": {
"value": "true",
"indicator": "dfsff_0_1"
},
"questions": [
{
"type": "date",
"options": [
""
],
"helpText": "",
"question": "Loss ?",
"required": true,
"indicator": "trewq_1_0",
"responseType": ""
},
{
"type": "boolean",
"options": [
""
],
"helpText": "",
"question": "",
"required": false,
"indicator": "trewq_1_1",
"responseType": ""
}
],
"sectionTitle": "section 2"
},
{
"condition": {
"value": "false",
"indicator": "trewq_1_1"
},
"questions": [
{
"type": "currency",
"options": [
""
],
"helpText": "dsds",
"question": "dsdsd",
"required": true,
"indicator": "dsd_2_0",
"responseType": "number"
}
],
"sectionTitle": "section 3"
}
]
}
解决方案
推荐阅读
- qbasic - QBasic 对比 快速基础
- mysql - mysql中mvcc快照的刷新原理
- java - @JacksonXmlProperty(isAttribute = true) 没有将元素视为属性
- php - 存档页面未显示其文件中定义的内容
- time-series - 接入节点会不会成为TimescaleDB横向扩展的瓶颈?
- python - 在新选项卡中打开链接,而不是单击类名找到的元素| Python
- php - 我试图显示我使用 longblob 和 PDO 上传到数据库的图像
- c - 动态结构数组中动态分配的字符串(段错误)
- c++ - 不同文件中的 C++ 命名空间
- swift - 有没有办法检测两个 SKSpriteNodes 同时占用多少区域?