📜  向 vue 添加很棒的字体 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:03.183000             🧑  作者: Mango

代码示例1
// import required libraries
npm install --save @fortawesome/fontawesome-svg-core 
npm install --save @fortawesome/free-solid-svg-icons
npm i --save @fortawesome/vue-fontawesome@prerelease

//in main.js include the following
import { library } from '@fortawesome/fontawesome-svg-core';
import { fas } from '@fortawesome/free-solid-svg-icons';
library.add(fas);

//include the fontawesome icons in the createApp function 
createApp(App).use(store).use(router).mount('#app').component('fa', FontAwesomeIcon);