使用火焰(流星)模板引擎不工作的铁图标中设置的聚合物 1.0 默认图标 [英] Polymer 1.0 default icon set in iron-icons not working using blaze (meteor) templating engine
本文介绍了使用火焰(流星)模板引擎不工作的铁图标中设置的聚合物 1.0 默认图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
升级到 Polymer 1.0 后,默认的铁图标集不起作用.我正在尝试使用默认图标集中的主页图标.
HTML 代码片段:
<link rel="import" href="/components/iron-icons/iron-icons.html"><link rel="import" href="/components/iron-icons/communication-icons.html"><link rel="import" href="/components/iron-form/iron-form.html"><link rel="import" href="/components/iron-selector/iron-selector.html"><link rel="import" href="/components/iron-pages/iron-pages.html"><!-- OOTB 纸元素--><link rel="import" href="/components/paper-drawer-panel/paper-drawer-panel.html"><link rel="import" href="/components/paper-header-panel/paper-header-panel.html"><link rel="import" href="/components/paper-toolbar/paper-toolbar.html"><link rel="import" href="/components/paper-icon-button/paper-icon-button.html"><link rel="import" href="/components/paper-material/paper-material.html"><link rel="import" href="/components/paper-menu/paper-menu.html"><link rel="import" href="/components/paper-item/all-imports.html"><link rel="import" href="/components/paper-tabs/paper-tab.html"><link rel="import" href="/components/paper-tabs/paper-tabs.html"><link rel="import" href="/components/paper-tabs/paper-tabs-icons.html"><paper-icon-item id="socialFeed"><iron-icon icon="home" item-icon></iron-icon><paper-item-body 两行><div>社交Feed</div>2 个未读的 FB 帖子</paper-item-body></paper-icon-item>
我在 Chrome 调试器中收到警告:[iron-icon::_updateIcon]:找不到图标集图标,您是否导入了图标集?
@ line#167 in iron-icon.html
调试显示在 Iron-icon.html 的第 163 行是
this._iconset = this.$.meta.byKey(this._iconsetName);
this._iconsetName
具有值 "icons" 但 this._iconset
未定义.
我是否遗漏了一些导入或其他东西?
EDIT 只有在 Meteor 中使用 Blaze 模板引擎时才会出现此问题.只是想为完整的图片添加这一点.
解决方案
现在得到了真正的解决方案(不是解决方法),因此打开了新的答案.
Chrome 调试器中出现警告的原因是按正确顺序加载链接导入的时机错误.
解决方案:
1.) 删除铁图标中的链接导入(以及其他需要的图标集,如地图、社交等...):
- 公开
- bower_components
- 铁图标
- iron-icons.html
- maps-icons.html(可选,如果您正在使用它们)
- social-icons.html(可选,如果您正在使用它们)
- 铁图标
- bower_components
铁图标.html:
之前: