課程
/前端開(kāi)發(fā)
/Vue.js
/快速了解新版Vue3.0 + Vite開(kāi)發(fā)
怎么引入第三方庫(kù),比如element-ui
2020-07-17
源自:快速了解新版Vue3.0 + Vite開(kāi)發(fā) 5-1
正在回答
可以用element plus
element3官網(wǎng):https://element3-ui.com/#/
npm?i?element3?-S
ant-design-vue? 剛發(fā)布的兼容vue3.0的ui庫(kù)? 可以試一下
目前element ui不支持Vue3.0,按照2.x的方式引入
import Element from 'element-ui'
createApp(App).use(Element).mount('#app')
頁(yè)面會(huì)報(bào)錯(cuò):
Cannot read property '$isServer' of undefined
需等待element官方重構(gòu)
其他ui庫(kù),如bootstrap(不推薦使用js部分,與vue的思想相違背),npm安裝好,直接import對(duì)應(yīng)的css樣式文件。由于深層import了css文件,根據(jù)vite的提示:
If the dependency requires deep import to function properly,?
add the deep path to optimizeDeps.include in vite.config.js.
配置好vite.config.js文件的對(duì)應(yīng)設(shè)置,即optimizeDeps.include
舉報(bào)
Vue3.0深入淺出,帶你領(lǐng)略最新的開(kāi)發(fā)神器Vite,助力Vue3.0開(kāi)發(fā)
1 回答新創(chuàng)建的項(xiàng)目升級(jí)成3.0 運(yùn)行出現(xiàn)的問(wèn)題 ,怎么辦
1 回答老師,vite.config.js中的環(huán)境變量沒(méi)有了如何獲?。?/p>
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢(xún)優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2021-07-07
可以用element plus
2021-01-20
element3官網(wǎng):https://element3-ui.com/#/
2020-09-04
ant-design-vue? 剛發(fā)布的兼容vue3.0的ui庫(kù)? 可以試一下
2020-09-01
目前element ui不支持Vue3.0,按照2.x的方式引入
import Element from 'element-ui'
createApp(App).use(Element).mount('#app')
頁(yè)面會(huì)報(bào)錯(cuò):
Cannot read property '$isServer' of undefined
需等待element官方重構(gòu)
其他ui庫(kù),如bootstrap(不推薦使用js部分,與vue的思想相違背),npm安裝好,直接import對(duì)應(yīng)的css樣式文件。由于深層import了css文件,根據(jù)vite的提示:
If the dependency requires deep import to function properly,?
add the deep path to optimizeDeps.include in vite.config.js.
配置好vite.config.js文件的對(duì)應(yīng)設(shè)置,即optimizeDeps.include