如何在Ionic 4项目中添加font-awsome? [英] How do I add font-awsome to Ionic 4 project?
本文介绍了如何在Ionic 4项目中添加font-awsome?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有人知道将font-awsome
添加到新的Ionic 4项目的方法(当前我正在使用4.0.0-beta.15
).
Does anyone knows the way of adding font-awsome
to new Ionic 4 project (currently I'm using 4.0.0-beta.15
).
将其添加到v3的方法在这里得到了很好的解释:
Adding it to v3 is nicely explained here:
https://charlouze .github.io/ionic/2017/05/31/Ionic-3-and-Font-Awesome.html
它适用于Ionic V3,但不幸的是不适用于V4.
and it works great for Ionic V3, but unfortunatelly not V4.
推荐答案
安装真棒字体
npm install font-awesome --save --save-exact
install font-awesome
npm install font-awesome --save --save-exact
copyFonts: {
src: [
'{{ROOT}}/node_modules/ionicons/dist/fonts/**/*',
'{{ROOT}}/node_modules/ionic-angular/fonts/**/*',
'{{ROOT}}/node_modules/font-awesome/fonts/**/*'],
dest: '{{WWW}}/assets/fonts'
},
sass.config.js
includePaths: [
'node_modules/ionic-angular/themes',
'node_modules/ionicons/dist/scss',
'node_modules/ionic-angular/fonts',
'node_modules/font-awesome/scss'
],
variable.scss
$fa-font-path: $font-path;
@import "font-awesome";
home.html
<i class="fa fa-users"></i>
请按照上述步骤操作.那对我有用.
Please follow the above steps. That is working for me.
这篇关于如何在Ionic 4项目中添加font-awsome?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文