We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如需添加 vue-stone提供的字体图标以外的字体图标,请自行添加,方法如下:
vue-stone
webpack-iconfont-plugin-nodejs
npm install webpack-iconfont-plugin-nodejs
build
svg2font.js
fontName
cssPrefix
例如:
var WebpackIconfontPluginNodejs = require('webpack-iconfont-plugin-nodejs'); var path = require('path'); var options = { fontName: 'extra-icon',//字体图标 font-family 的名称,不要使用‘iconfonts’这个名字 svgs: path.join(__dirname, '../', 'src/svgs/*.svg'), fontsOutput: path.join(__dirname, '../', 'src/styles/fonts/'), cssOutput: path.join(__dirname, '../', 'src/styles/font.css'), jsOutput: path.join(__dirname, '../', 'src/styles/fonts.js'), htmlOutput: path.join(__dirname, '../', 'src/styles/font-preview.html'), cssPrefix: 'ex-icon' // 字体图标类名前缀 }; new WebpackIconfontPluginNodejs(options).build();
src
svgs
.svg
如:
node build/svg2font.js
就会生成相关的字体图标文件到 styles文件夹中 按照上面的配置生成的结果如下:
styles
font-preview.html可以预览到你生成的字体图标及其名称
font-preview.html
fonts.css
main.js中引入:
main.js
import '@/styles/font.css';
The text was updated successfully, but these errors were encountered:
No branches or pull requests
如需添加
vue-stone
提供的字体图标以外的字体图标,请自行添加,方法如下:1. 安装插件
webpack-iconfont-plugin-nodejs
2. 在项目的
build
文件夹下,添加或修改svg2font.js
fontName
和cssPrefix
fontName
对应字体图标的 font-family 名称,不要使用‘iconfonts’这个名字cssPrefix
表示生成的字体图标的类名前缀例如:
3. 在
src
文件夹下新建svgs
文件夹,并向svgs
文件夹中添加自定义的.svg
文件如:
4. 执行 node 命令
node build/svg2font.js
就会生成相关的字体图标文件到
styles
文件夹中按照上面的配置生成的结果如下:
font-preview.html
可以预览到你生成的字体图标及其名称5. 在项目中引入
fonts.css
;main.js
中引入:The text was updated successfully, but these errors were encountered: