【发布时间】:2018-09-25 10:54:38
【问题描述】:
我将mustache 与enter link description herepattern lab 结合使用,从json 数据文件中呈现出项目列表。鉴于此数据结构:
{
"states": {
"dropdown": {
"items": [
{
"title": "CA"
},
{
"title": "OR"
},
{
"title": "TX"
}
]
}
},
"roles": {
"dropdown": {
"items": [
{
"title": "Mid-level Office Manager"
},
{
"title": "Facility Manager"
},
{
"title": "Resources Coordinator"
}
]
}
}
}
如果我在我的部分中执行以下操作:
{{#states}}
{{#dropdown.items}}{{title}}{{/dropdown.items}}
{{/states}}
名称渲染得很好。
但如果我这样做:
{{#states}}
{{> molecules-dropdown-picker(btnDropdownToggleLabel: "OR")}}
{{/states}}
下拉选择器部分代码如下:
{{#dropdown.items}}{{title}}{{/dropdown.items}}
它不会渲染。我做错了什么?
【问题讨论】:
标签: json templates mustache partials patternlab.io