So after installing Vue 3.0 based component library (Element-Plus) in my project using npm install element-plus --save, I get this error that says app.use is not a function. I have also imported Element fully like so:
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import "./assets/Css/Style.css"
app.use(ElementPlus)
createApp(App).use(router).mount('#app').
But I get the under-listed error. Uncaught TypeError: app.use is not a function
You need to initialize Vue with createApp(), before you can use .use. Like this:
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import "./assets/Css/Style.css"
const app = createApp(App)
app.use(ElementPlus)
app.use(router)
app.mount('#app').