我试图创建一个本地字体模型,以便能够将其导入到我的vuejs应用程序中,但我没有成功,有人能帮助我吗?
字体.js
import { library } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { faUserSecret } from '@fortawesome/free-solid-svg-icons'
library.add(faUserSecret)
export default [library, FontAwesomeIcon, faUserSecret]
main.js
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import './assets/main.css'
import library from './models/fontAwesome'
const app = createApp(App)
app.use(createPinia())
app.use(router)
app.component('font-awesome-icon', library)
app.mount('#app')`your text``
1条答案
按热度按时间6tdlim6h1#
我通过创建一个Vue插件解决了这个问题。希望这能有所帮助。