From 14a69608f857369a99eaa43279154398cae581ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B5=B7=E4=BA=91?= Date: Fri, 26 May 2017 14:58:13 +0800 Subject: [PATCH] Update syntax.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit list语法中增加便利对象时,获取item key的方式:item_key --- source/_api/_docs/syntax.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/_api/_docs/syntax.md b/source/_api/_docs/syntax.md index bd257c0..66eddb1 100644 --- a/source/_api/_docs/syntax.md +++ b/source/_api/_docs/syntax.md @@ -631,6 +631,24 @@ component.$inject(document.body); ``` +```js +var component = new Regular({ + template: + "{#list items as item}\ + {item_key}:{item}\ + {/list}", + data: { + items: { + a: 'a-1', + b: 'b-2', + c: 'c-3' + } + } +}) + +component.$inject(document.body); +``` + __resulting html__ ```html