40 lines
889 B
TypeScript
40 lines
889 B
TypeScript
// SSR-friendly Font Awesome plugin
|
|
// Registers the Vue component and a small set of icons so server-render and client-render match.
|
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
|
// Import a conservative set of icons used in the admin UI
|
|
import {
|
|
faHouse,
|
|
faUsers,
|
|
faCogs,
|
|
faNewspaper,
|
|
faTags,
|
|
faHashtag,
|
|
faRightFromBracket,
|
|
faPlus,
|
|
faWandMagic,
|
|
faGaugeHigh,
|
|
faShieldAlt
|
|
} from '@fortawesome/free-solid-svg-icons'
|
|
|
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
// Add selected icons to the library
|
|
library.add(
|
|
faHouse,
|
|
faUsers,
|
|
faCogs,
|
|
faNewspaper,
|
|
faTags,
|
|
faHashtag,
|
|
faRightFromBracket,
|
|
faPlus,
|
|
faWandMagic,
|
|
faGaugeHigh,
|
|
faShieldAlt
|
|
)
|
|
|
|
// Globally register component
|
|
nuxtApp.vueApp.component('FontAwesomeIcon', FontAwesomeIcon)
|
|
})
|
|
|