WebIndex/plugins/fontawsome.ts

32 lines
957 B
TypeScript
Raw Normal View History

2024-11-17 11:45:08 +08:00
import {library, config} from '@fortawesome/fontawesome-svg-core'
import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'
import {faClock} from '@fortawesome/free-regular-svg-icons'
import {
faXmark,
faBlog,
faGauge,
faCodeBranch,
faCloud,
faChevronRight,
faCodeCommit,
faCode,
faHouse,
faPen,
faBrush,
faChessRook,
faBars,
faChevronDown
} from '@fortawesome/free-solid-svg-icons'
import {faWeibo, faQq, faGithubAlt, faSteamSymbol} from '@fortawesome/free-brands-svg-icons'
// 因为默认添加了 nuxt会造成一些错误所以不自动添加样式
config.autoAddCss = false
export default defineNuxtPlugin((nuxtApp) => {
library.add(
faClock, faXmark, faBlog, faGauge, faCodeBranch, faCloud, faWeibo, faQq, faGithubAlt, faSteamSymbol, faChevronRight,
faCodeCommit, faCode, faHouse, faPen, faBrush, faChessRook, faBars, faChevronDown
)
nuxtApp.vueApp.component('font-awesome-icon', FontAwesomeIcon)
})