Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ektx/handlebarjs

Handlebarjs练习案例
https://github.com/ektx/handlebarjs

Last synced: about 1 month ago
JSON representation

Handlebarjs练习案例

Awesome Lists containing this project

README

        

Handlebars 笔记

1.访问父级的属性 [../]:
"spe_data": [
{
"spe_tpl": "spe_radios",
"spe_Rname": "myRadios01",
"spe_childArray": [
{"spe_name":"单件A", "rad_val":"0", "isChecked":"checked"},
{"spe_name":"单件B", "rad_val":"1"}
]
},

{
"spe_tpl": "spe_checkbox",
"spe_childArray": [
{"spe_name":"单件AA", "rad_val":"0", "isChecked":"checked"}
]
}

],
如在此代码是我们如下操作,
{{#each spe_childArray}}

{{spe_name}}

{{/each}}
那么name="{{spe_Rname}}"是无法获得的,我们可以使用 name="{{../spe_Rname}}"来访问上级元素