설치 플러그인
npm i --save @fortawesome/fontawesome-svg-core
npm i --save @fortawesome/free-solid-svg-icons
npm i --save @fortawesome/free-regular-svg-icons
npm i --save @fortawesome/free-brands-svg-icons
// Vue2 ( Vue2로 이용할 때 )
npm i --save @fortawesome/vue-fontawesome
// Vue3 ( Vue3로 이용할 때 )
npm i --save @fortawesome/vue-fontawesome@prerelease
main.js
import { library } from '@fortawesome/fontawesome-svg-core'
import { fas } from '@fortawesome/free-solid-svg-icons'
import { far } from '@fortawesome/free-regular-svg-icons'
import { fab } from '@fortawesome/free-brands-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
library.add(fab, far, fas)
const app = createApp(App)
// fa = 변경가능
app.component("fa", FontAwesomeIcon)
app.use(store).use(router).mount('#app')
App.vue ( 사용할 페이지 )
<fa :icon="['fab', 'html5']" />
fontawesome에서 아이콘을 찾아서 넣기만 하면 완료된다.
'VueJS > VueJS' 카테고리의 다른 글
[ Vue ] NUXT JS 구글 웹 폰트 사용하기 (0) | 2022.04.25 |
---|---|
[ Vue ] NUXT JS 정적, 동적 이미지 추가하기 (0) | 2022.04.25 |
[ Vue ] NUXT JS 글로벌 SCSS (0) | 2022.04.25 |
[ Vue ] NUXT JS 외부 리소스 jQuery 사용하기 (0) | 2022.04.25 |
[ Vue ] Vue3 이미지 슬라이더 (0) | 2022.04.13 |