Vue3 framework uses error reporting and solutions

1、TypeError: Failed to fetch dynamically imported module:

When importing components, the .vue suffix is ​​not added or the imported components are not used

2、SyntaxError: The requested module '/node_modules/[email protected]@schart.js/lib/sChart.min.js?v=0343bb8c' does not provide an export named 'default'

version problem

3. cnpm installs element-plus and reports an error

4. yarn add element-plus --save error

5. After stopping the project, reinstall 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' configuration error

bug fix

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. The display problem of the el-submenu component in vue3+element-plus

el-submenu, but there is a problem with the display, and it cannot be displayed normally. It seems to be a problem with this component. After searching around, I couldn’t find a solution. Finally, I looked at the official document and found that el-submenu has become el-sub-menu

Guess you like

Origin blog.csdn.net/chenacxz/article/details/125435799
Recommended