聚合物1嵌套的dom(如果dom重复内)在数据更改时不更新 [英] Polymer 1 nested dom-if within dom-repeat not updating when data changes

查看:116
本文介绍了聚合物1嵌套的dom(如果dom重复内)在数据更改时不更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当数据更改时,如何在dom-repeat更新中创建dom-if模板?

How do you make dom-if templates within dom-repeat's update when the data changes??

此处的示例http://jsbin.com/xatala/edit?html,输出

在该示例中,数据在1.5秒后发生更改,但是模板内部的dom-if未被重新评估/渲染.您可以在console.log中看到它.数据已更改,但视图未更新.

In the example the data changes after 1.5 seconds but the dom-if's inside the template aren't re-evaluated/rendered. You can see this in the console.log. The data has changed but the view isn't updated.

您将如何进行这项工作,其背后的原因是什么?!

How would you make this work and what is the reasoning behind it?!

推荐答案

以下是适用的示例:

您所缺少的是:

通过索引显式绑定到数组项不支持

在Bin中添加了一些说明. 相关链接:

Some explanations are added in the Bin. Related links:

聚合物,无法绑定到数组项

http://plnkr.co/edit/aOmw4e?p=preview

这篇关于聚合物1嵌套的dom(如果dom重复内)在数据更改时不更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆