聚合物1.0全局变量 [英] Polymer 1.0 Global Variables

查看:113
本文介绍了聚合物1.0全局变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Polymer 0.5中,关于全局变量的建议与本问题/答案中概述的一样:

聚合物全局变量



然而在Polymer 1.0中,这似乎不起作用。更改通知不会自动在基础模型上生成,而是在< dom-module> 上生成,这意味着更改通知将仅在< APP-全局>



在Polymer 1.0中实现此模式的推荐方式是什么?

解决方案

聚合物元素 < iron-meta> 也是一个选项。对我来说,这是最简单的解决方案。


In Polymer 0.5 the advice on globals was as outlined in this question/answer:

Polymer global variables

However in Polymer 1.0 this doesn't seem to work. Change notifications are not automatically generated on the underlying model, they are generated on the <dom-module> instead which means that change notifications will be generated on only one of the <app-globals>.

What is the recommended way of implementing this pattern in Polymer 1.0?

解决方案

Polymer element <iron-meta> is also an option. For me this was the easiest solution.

这篇关于聚合物1.0全局变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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