【发布时间】:2018-01-13 23:16:15
【问题描述】:
我是聚合物 2 的新手,看来,要加载聚合物元素,您需要导入一个 html 文件,其中包含以下 3 个 html 导入:
1. the polyfill
2. the main polymer element class
3. and then potentially extras like iron-input.html or dom-repeat.html
如果我随后将 5 个不同元素的 5 个聚合物元素 html 文件导入到我的主页中,我将获得上述 3 个导入的 5 倍。您如何避免所有这些重复以及大量导入 DOM?
我应该手动从 5 个文件中删除所有导入语句吗?每个只保留 1 个?
https://www.polymer-project.org/2.0/start/quick-tour
谢谢
【问题讨论】:
标签: javascript polymer