有没有办法在paper-icon-button中使用图标from the Font Awesome library作为图标
Here is my jsBin。
http://jsbin.com/rahesepeho/2/edit?html,output
<!doctype html>
<head>
<meta name="description" content="iron-data-table beta3">
<meta charset="utf-8">
<base href="https://polygit.org/components/">
<script src="webcomponentsjs/webcomponents-lite.min.js"></script>
<link href="polymer/polymer.html" rel="import">
<link href="paper-icon-button/paper-icon-button.html" rel="import">
</head>
<body>
<dom-module id="x-foo">
<style>
:host {
font-family: arial, sans-serif;
}
</style>
<template>
<p>The below <code>paper-icon-button</code> uses an image from Github.</p>
<paper-icon-button
src="https://assets-cdn.github.com/images/modules/logos_page/Octocat.png"
alt="octocat" title="octocat">
</paper-icon-button>
<p>How do I make the below <code>paper-icon-button</code> use an icon from <a href="http://fontawesome.io/icons/" target="_blank">Font Awesome</a>?</p>
<paper-icon-button
src="https://assets-cdn.github.com/images/modules/logos_page/Octocat.png"
alt="octocat" title="octocat">
</paper-icon-button>
</template>
<script>
document.addEventListener('WebComponentsReady', function() {
Polymer({
is: 'x-foo'
});
});
</script>
</dom-module>
<x-foo></x-foo>
</body>发布于 2018-01-25 00:51:51
你可以使用这个项目!在聚合物1-2中使用是很酷的,鲍尔包装。现在是FA: 4.7的最后一个版本。这里:https://github.com/vangware/fontawesome-iconset
发布于 2017-03-12 06:34:01
在我的例子中,在聚合物v1.8上,我必须创建一个自定义样式元素,就像这个link中描述的那样,将字体粘贴到那里,然后使用以下命令将其添加到我的元素中
<template>
<style include="shared-styles">
</style>
<paper-button> <i class="fa fa-facebook fa-lg"></i></paper-button>
..............
</template>https://stackoverflow.com/questions/38259201
复制相似问题