我在车把中有一个简单的条件语句,我检查是否为condition one and condition two is true then print true
但是第二个条件是嵌套的。
我的首要条件是检查标题是否为测试
我的第二个条件是检查标签是否为奶油
第一次服用第二剂无效。
谁能看到第二个为什么不起作用,为什么我无法打印True?
Json
"one": [
{
"title": "test",
"slider": {
"slides": [
"img/placeholders/WAY-MATERIA-Snaidero.jpg",
"img/placeholders/image_kitchen.jpg",
"img/placeholders/WAY-MATERIA-Snaidero.jpg",
"img/placeholders/image_kitchen.jpg",
"img/placeholders/WAY-MATERIA-Snaidero.jpg",
"img/placeholders/image_kitchen.jpg",
"img/placeholders/WAY-MATERIA-Snaidero.jpg",
"img/placeholders/image_kitchen.jpg",
"img/placeholders/WAY-MATERIA-Snaidero.jpg",
"img/placeholders/image_kitchen.jpg",
"img/placeholders/WAY-MATERIA-Snaidero.jpg",
"img/placeholders/image_kitchen.jpg"
],
"thumbnails": [
"img/placeholders/WAY-MATERIA-Snaidero_60x46.jpg",
"img/placeholders/image_kitchen_60x46.jpg",
"img/placeholders/WAY-MATERIA-Snaidero_60x46.jpg",
"img/placeholders/image_kitchen_60x46.jpg",
"img/placeholders/WAY-MATERIA-Snaidero_60x46.jpg",
"img/placeholders/image_kitchen_60x46.jpg",
"img/placeholders/WAY-MATERIA-Snaidero_60x46.jpg",
"img/placeholders/image_kitchen_60x46.jpg",
"img/placeholders/WAY-MATERIA-Snaidero_60x46.jpg",
"img/placeholders/image_kitchen_60x46.jpg",
"img/placeholders/WAY-MATERIA-Snaidero_60x46.jpg",
"img/placeholders/image_kitchen_60x46.jpg"
]
},
],
"colors": [
{
"color": "#F3DCAE",
"label": "Cream",
"href" : "http://google.com"
}
]
},
]
.HBS文件
{{#if_eq title 'Glencoe range'}}
{{#if_eq colors.label 'White'}}
True
{{/if_eq}}
{{/if_eq}}
我的gulp文件
handlebars.Handlebars.registerHelper('if_eq', function(a, b, opts) {
if (a === b) {
return opts.fn(this);
} else {
return opts.inverse(this);
}
});