1.有說vue版本有兩個,但檢查之后發(fā)現(xiàn)只有一個,且為vue3的版本
2.也有說是因為命名的問題,組件名和頁面名一致
最后發(fā)現(xiàn)是因為
在main.js里面引入element plus 使用這種use方式會報錯,雖然也不知道為什么
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 store from './store'
createApp(App).use(store).use(router).use(ElementPlus).mount('#app')
改為以下這種寫法之后就沒有報錯了
createApp(App).use(store).use(router).mount('#app')
const app = createApp(App)
app.use(ElementPlus)
但改為這種寫法卻引入失敗 使用組件并不能生效文章來源:http://www.zghlxwxcb.cn/news/detail-515010.html
過后很久又改回之前的那種寫法 不僅沒有報錯也沒有報下面這種警告
并且一切正?!,F(xiàn)在還是不知道是什么原因 如果有大佬知道可以指點一下。文章來源地址http://www.zghlxwxcb.cn/news/detail-515010.html
到了這里,關(guān)于vue3和element plus踩坑的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!