【发布时间】:2018-02-14 02:03:19
【问题描述】:
我是 Polymer 项目的新手,我已经安装了 polymer 2.0 starterkit,除了铁图标外一切正常。运行项目时它不显示图标。
<!-- Load the Polymer.Element base class -->
<link rel="import" href="../bower_components/polymer/polymer-element.html">
<script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../bower_components/iron-icon/iron-icon.html">
<link rel="import" href="../bower_components/iron-iconset-svg/iron-iconset-svg.html">
<dom-module id="my-iconsset-view">
<!-- Defines the element's style and local DOM -->
<template>
<style>
:host {
display: block;
padding: 16px;
}
</style>
<h1>My Iconsc</h1>
<iron-icon icon="icon:menu"></iron-icon>
<iron-icon icon="input"></iron-icon>
</template>
<script>
// Your new element extends the Polymer.Element base class
class MyIconssetView extends Polymer.Element {
static get is() { return 'my-iconsset-view'; }
}
//Now, register your new custom element so the browser can use it
customElements.define(MyIconssetView.is, MyIconssetView);
</script>
</dom-module>
【问题讨论】: