当数据发生变化时,如何在dom-if
的更新中制作dom-repeat
个模板?
此处示例http://jsbin.com/xatala/edit?html,output
在示例中,数据在1.5秒后发生变化,但模板内的dom-if不会被重新评估/渲染。您可以在console.log中看到这一点。数据已更改,但视图未更新。
你将如何完成这项工作?背后的原因是什么?!
答案 0 :(得分:4)
以下示例有效:http://jsbin.com/nejadibuju/edit?html,console,output
<template is="dom-if"
if="{{arrayItem(myItems.*, index, 'isGood')}}">
[[item.title]] is SOOO good.
</template>
你缺少的是:
Bin中添加了一些解释。 相关链接: