[Vuejs]-Vite problem: element-plus can not use import type

0👍

you must configure elementPlus in your main.js file.

import './assets/main.css'

import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'

createApp(App)
.use(ElementPlus)
.mount('#app')

then in your views you use the components as in the documentation

<el-button type="primary">Primary</el-button>

0👍

in your tsconfig.json add this:

"include": ["./src/**/*"]

Leave a comment