寻找一种方法来实现这一点:
{{#each someArray}}
{{../otherObject.[this]}}
{{/each}}
如何评估
this
的值然后将其作为我的对象 otherObject
的键引用?
最佳答案
查找:https://handlebarsjs.com/guide/builtin-helpers.html#lookup
{{#each someArray}}
{{lookup ../otherObject this}}
{{/each}}
关于javascript - Handlebars.js - 使用变量键访问对象值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19646244/