vue3.0 + fontAwesome 图标

1、安装 vue-fontawesome:

npm i --save @fortawesome/vue-fontawesome@prerelease
npm i --save @fortawesome/fontawesome-svg-core
npm i --save @fortawesome/free-solid-svg-icons

 

 2、main.ts 引入:

import { library } from '@fortawesome/fontawesome-svg-core'
import { fas } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
library.add(fas)
createApp(App).use(I18n).component("font-awesome-icon", FontAwesomeIcon).mount('#app');

3、页面使用;

<template>
    <div>交易信息
        <font-awesome-icon icon="calendar" style="color:green" />
    </div>
</template>

 

posted @ 2021-06-15 10:07  小蘑菇123  阅读(1114)  评论(0编辑  收藏  举报