WebIndex/plugins/fontawsome.ts

35 lines
1.0 KiB
TypeScript
Raw Normal View History

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