一、問(wèn)題描述
在VUE3開發(fā)環(huán)境中想安裝element ui前端庫(kù),執(zhí)行"npm install element-ui --save"命令進(jìn)行安裝時(shí),出現(xiàn)以下錯(cuò)誤信息:
二、原因分析
element-ui不適配vue3,官方已將vue3版本的更新為element-plus.
Element-ui適用于Vue2框架
Element-plus適用于Vue3框架文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-536271.html
三、解決辦法
在VUE3的開發(fā)環(huán)境下安裝element-plus,執(zhí)行如下命令即可:文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-536271.html
npm install element-plus --save
四、使用方法
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import elementPlus from 'element-plus'
import 'element-plus/theme-chalk/index.css';
const app=createApp(App);
app.use(elementPlus);
到了這里,關(guān)于VUE3安裝element ui 失敗的原因及解決方法的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!