2
我有一個「國家」的對象,我傳遞的把手上下文的一部分:查找助手在車把
{
'hk': {'name': 'Hong Kong', 'someotherprop': 'someothervalue'},
'us': {'name': 'United States', 'someotherprop': 'yetanothervalue'},
...
}
我想使用查找車把助手從COUNTRYCODE「香港」名義'找香港'。
我可以使用下面的把手指令
{{lookup ../countries countrycode}}
得到以下對象
{'name': 'Hong Kong', 'someotherprop': 'someothervalue'}
但我現在該如何提取此對象的name屬性?
而且,如果你需要訪問多個屬性,例如'name'和'someotherprop',你可以使用'{{#with(lookup ../countries countrycode)}} {{name}} {{someotherprop}} {{/ with}}'http://stackoverflow.com /一個/1487413分之42520682 –