Vue3框架使用報(bào)錯(cuò)以及解決方案
Vue3框架使用報(bào)錯(cuò)及解決
1、TypeError: Failed to fetch dynamically imported module:
引入組件時(shí),沒有添加.vue后綴 或者引入的組建沒有被使用
2、SyntaxError: The requested module '/node_modules/_schart.js@3.0.4@schart.js/lib/sChart.min.js?v=0343bb8c' does not provide an export named 'default'
版本問題
3、cnpm安裝element-plus報(bào)錯(cuò)
4、yarn add element-plus --save報(bào)錯(cuò)
5、把項(xiàng)目停止運(yùn)行之后重新安裝ok了
6、vite.config.ts Cannot find module 'path' or its corresponding type declarations
npm install @types/node --save-dev
7、vue.config.ts import path from 'path' 配置報(bào)錯(cuò)
Module '"path"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import { resolve } from 'path' export default defineConfig({ plugins: [vue()], resolve: { // 配置別名 alias: { "@": resolve(__dirname, "src"), "@c": resolve(__dirname, "src/components"), } } })
8、vue3+element-plus里面的el-submenu組件顯示問題
el-submenu,但是顯示出了問題,不能正常顯示。
感覺是這個(gè)組件的問題,查了一圈沒找到解決方法,最后看官方文檔發(fā)現(xiàn)el-submenu變成了el-sub-menu
VUE3+Echarts報(bào)錯(cuò)Cannot read property ‘type‘ of undefined
最近在做Echarts項(xiàng)目的時(shí)候,在組件引用的時(shí)候出現(xiàn)了一點(diǎn)小問題
左下角的組件應(yīng)用之后,控制臺(tái)報(bào)錯(cuò)且連帶著右側(cè)兩個(gè)能正常運(yùn)行的組件失效了。
查閱資料,發(fā)現(xiàn)可能是“商家銷售統(tǒng)計(jì)”的組件在數(shù)據(jù)讀取是響應(yīng)式的原因,在響應(yīng)代碼中加上
import { markRaw } from '@vue/reactivity';
在圖表初始化的引用中加上markRaw()
initChart() { this.chartInstance = markRaw(echarts.init(this.$refs.rank_ref, this.theme)) //對圖表初始化配置進(jìn)行控制 const initOption = { },
問題解決
總結(jié)
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
vue實(shí)現(xiàn)消息的無縫滾動(dòng)效果的示例代碼
本篇文章主要介紹了vue實(shí)現(xiàn)消息的無縫滾動(dòng)效果的示例代碼,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-12-12Vue中@click.stop和@click.prevent實(shí)例詳解
當(dāng)我們使用Vue.js開發(fā)前端應(yīng)用時(shí),經(jīng)常會(huì)在模版中使用@click指令來響應(yīng)用戶的點(diǎn)擊事件,這篇文章主要給大家介紹了關(guān)于Vue中@click.stop和@click.prevent的相關(guān)資料,需要的朋友可以參考下2024-04-04vue3 ts組合式API異常onMounted is called when&
這篇文章主要為大家介紹了vue3 ts組合式API異常onMounted is called when there is no active component問題解決,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-05-05解決vue-element-admin安裝依賴npm install報(bào)錯(cuò)問題
這篇文章主要介紹了解決vue-element-admin安裝依賴npm install報(bào)錯(cuò)問題,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2024-06-06vue3 el-upload單張圖片回顯、編輯、刪除功能實(shí)現(xiàn)
這篇文章主要介紹了vue3 el-upload單張圖片回顯、編輯、刪除功能實(shí)現(xiàn),圖片回顯時(shí)隱藏上傳區(qū)域,鼠標(biāo)懸浮顯示遮罩層進(jìn)行編輯、刪除操作,刪除圖片后顯示上傳區(qū)域,本文通過實(shí)例代碼分享實(shí)現(xiàn)方法,感興趣的朋友一起看看吧2023-12-12