talent-plugin-iconfont
v2.0.1
Published
a iconfont plugin for wepy
Downloads
2
Readme
简介
talent-plugin-iconfont
是在wepy环境中的插件。在使用wepy开发微信小程序时,可以用它方便的引入iconfont。
使用
安装
npm install talent-plugin-iconfont
or
yarn add talent-plugin-iconfont
配置
首先需要找到iconfont链接中的tag。在这段iconfont的css地址中//at.alicdn.com/t/font_964045_4hbvi55v0tg.css
,font_964045_4hbvi55v0tg
需要在配置文件中使用。具体内容根据iconfont中的路径为准。
wepy.config.js
const IconfontPlugin = require('talent-plugin-iconfont')
module.exports = {
plugins: {
'iconfont': {
tag: 'font_964045_4hbvi55v0tg' // 上面步骤提取的值
}
}
}
模板语法
在*.wpy
文件中可以使用iconfont的Font class模式使用iconfont,假如在iconfont中的class name为icon-user
,那么在模板语法中可以这样使用
<i class="iconfont icon-user" />