1命令引入?yún)⒄展俜轿臋n:https://element.eleme.cn/#/zh-CN/component/installation
npm i element-ui -S
main.js中引入
報錯后 看官方文檔 發(fā)現(xiàn)vue3已經(jīng)不支持原來的餓了么ui了 需要使用與vue3適配的Element-plus
官網(wǎng)說明 :https://element-plus.gitee.io/#/zh-CN/component/installation
這次是得注意安裝 element-plus文章來源:http://www.zghlxwxcb.cn/news/detail-642598.html
npm install element-plus --save
最后安裝后官網(wǎng)代碼案例為:文章來源地址http://www.zghlxwxcb.cn/news/detail-642598.html
import { createApp } from 'vue'
import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css';
import App from './App.vue';
const app = createApp(App)
app.use(ElementPlus)
app.mount('#app')
到了這里,關(guān)于Vue3.0正確引入Element UI組件的正確姿勢 (Element-plus)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!