Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ektx/handlebarjs
Handlebarjs练习案例
https://github.com/ektx/handlebarjs
Last synced: about 1 month ago
JSON representation
Handlebarjs练习案例
- Host: GitHub
- URL: https://github.com/ektx/handlebarjs
- Owner: ektx
- Created: 2014-11-21T14:28:48.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-06T13:45:54.000Z (over 9 years ago)
- Last Synced: 2024-04-14T07:20:01.700Z (9 months ago)
- Language: JavaScript
- Size: 176 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.txt
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}}"来访问上级元素