first commit
This commit is contained in:
39
app/plugins/fontawesome.ts
Normal file
39
app/plugins/fontawesome.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
// 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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user