FortAwesome / vue-fontawesome

Font Awesome Vue component
https://fontawesome.com
MIT License
2.39k stars 132 forks source link

Documentation example do not work with Vue 3 cli #368

Closed codigoisaac closed 2 years ago

codigoisaac commented 2 years ago

The readme describes the setting up of vue-fontawesome in a way that doesn't seem to work anymore with Vue3 cli.

The Readme says:

import Vue from 'vue'
import App from './App'
import { library } from '@fortawesome/fontawesome-svg-core'
import { faUserSecret } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'

library.add(faUserSecret)

Vue.component('font-awesome-icon', FontAwesomeIcon)

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  components: { App },
  template: '<App/>'
})

But this generates the error:

ReferenceError Vue is not defined

Sem título

Reproducible test case https://codesandbox.io/s/font-awesome-vue-docs-example-dont-work-ixgbuf?file=/src/main.js

Additional context In my project, what I do for vue-fontawesome to work is

createApp(App).component('font-awesome-icon', FontAwesomeIcon).use(router).mount('#app')
jasonlundien commented 2 years ago

Hi @codigoisaac -- we have updated our docs for Vue 3. You can check them out here. I will go ahead and close this issue. If you feel that it needs to remain open just let me know.