纸图标按钮不显示图标
paper-icon-button doesn't show the icon
你好,我有一个应用程序,我想在其中使用纸图标按钮,我使用的是 Dark [Theme][1] 主题,问题是我无法制作纸-显示图标的图标按钮。
进口:
<link rel="import" href="../bower_components/iron-iconset-svg/iron-iconset-svg.html">
<link rel="import" href="../bower_components/iron-iconset/iron-iconset.html">
<link rel="import" href="../bower_components/iron-icons/iron-icons.html">
<link rel="import" href="../bower_components/iron-icons/editor-icons.html">
<link rel="import" href="../bower_components/iron-icons/communication-icons.html">
<link rel="import" href="../bower_components/iron-icons/notification-icons.html">
<link rel="import" href="../bower_components/iron-icons/maps-icons.html">
<link rel="import" href="../bower_components/iron-icons/social-icons.html">
<link rel="import" href="../bower_components/iron-icon/iron-icon.html">
<!-- Paper elements -->
<link rel="import" href="../bower_components/paper-icon-button/paper-icon-button.html">
元素:
<dom-module id="my-adminwork">
<template>
<style>
:host {
display: block;
},
</style>
<iron-localstorage name="my-signasafe-storage" id="localStorage_id" value="{{sessionObject}}"></iron-localstorage>
<span>Text example</span>
<paper-icon-button icon="refresh"></paper-icon-button>
</template>
paper-icon-button 应该是铁图标元素的组合,里面有 svg 图标,当我在浏览器中签入 html 时,我没有看到 svg 图标代码在 iron-icon 元素里面。
知道为什么会这样吗?
问题是您 defined a custom iconset named "icons" 与 Polymer 的默认图标集同名。这会导致图标查找在 my-icons.html
中搜索您的自定义图标集,以查找实际上属于 iron-icons.html
中默认图标集的图标。
要解决此问题,请更改自定义图标集的名称(例如,更改为 "my-icons")。
你好,我有一个应用程序,我想在其中使用纸图标按钮,我使用的是 Dark [Theme][1] 主题,问题是我无法制作纸-显示图标的图标按钮。
进口:
<link rel="import" href="../bower_components/iron-iconset-svg/iron-iconset-svg.html">
<link rel="import" href="../bower_components/iron-iconset/iron-iconset.html">
<link rel="import" href="../bower_components/iron-icons/iron-icons.html">
<link rel="import" href="../bower_components/iron-icons/editor-icons.html">
<link rel="import" href="../bower_components/iron-icons/communication-icons.html">
<link rel="import" href="../bower_components/iron-icons/notification-icons.html">
<link rel="import" href="../bower_components/iron-icons/maps-icons.html">
<link rel="import" href="../bower_components/iron-icons/social-icons.html">
<link rel="import" href="../bower_components/iron-icon/iron-icon.html">
<!-- Paper elements -->
<link rel="import" href="../bower_components/paper-icon-button/paper-icon-button.html">
元素:
<dom-module id="my-adminwork">
<template>
<style>
:host {
display: block;
},
</style>
<iron-localstorage name="my-signasafe-storage" id="localStorage_id" value="{{sessionObject}}"></iron-localstorage>
<span>Text example</span>
<paper-icon-button icon="refresh"></paper-icon-button>
</template>
paper-icon-button 应该是铁图标元素的组合,里面有 svg 图标,当我在浏览器中签入 html 时,我没有看到 svg 图标代码在 iron-icon 元素里面。
知道为什么会这样吗?
问题是您 defined a custom iconset named "icons" 与 Polymer 的默认图标集同名。这会导致图标查找在 my-icons.html
中搜索您的自定义图标集,以查找实际上属于 iron-icons.html
中默认图标集的图标。
要解决此问题,请更改自定义图标集的名称(例如,更改为 "my-icons")。