-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请教下下面的需求如何实现比较好? #498
Comments
试试这样,手头没环境,不确定是不是完全正确,理论上可行: <!-- for: ${items} as ${item}, ${index} -->
<div data-ui-type="FooUI" data-ui-value="@items.${index}"></div>
<!-- /for --> |
居然可以。。 <!-- for: ${items} as ${item}, ${index} -->
<div data-ui-type="FooUI" data-ui-value="@items[${index}]"></div>
<!-- /for --> 之前试过这样,从getProperty方法来看不行,忘了还有这样的写法。。正好getProperty里面当作字符串属性名来获取了 function getProperty(target, path) {
...
value = value[path[i]];
}
return value;
} 这是误打误撞还是原来已经考虑到了。。 |
做etpl和esui之初就讨论过 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Model.js
Tpl
这里假设FooUI是我自定义的一个ui组件,我希望通过items遍历出多个ui,但是这里${item}模板变量替换后是字符串的'[Object object]',导致FooUI的值是'[Object object]'而无法正常初始化
请教这里改如何设计FooUI或者如何书写模板?
The text was updated successfully, but these errors were encountered: