我有这个 json:
"bg-image": {
"sm": "",
"md": "",
"unique" : ""
}
我有这个代码:
{{#if bg-image }}
<style>
@media screen and (max-width:642px) {
.masthead {
background-image: url({{bg-image.sm}});
}
}
@media screen and (min-width:643px) {
.masthead {
background-image: url({{bg-image.md}});
}
}
</style>
{{/if}}
但我想做这样的事情:
{{#if !bg-image.unique}}// then set bg-image.sm or bg-image.md {{/if}}
最佳答案
关于javascript - 如何在 Handlebars 中设置 (!)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50310906/