vue3 + vite + element-plus 所有的组件都提示下面的错误?
项目运行和编译都没有问题只是vscode中一直都有红色波浪线警告。
而且只是element-plus的组件报错,其他的不报错
tsconfig.json
{
"compilerOptions": {
"outDir": "./",
"target": "esnext",
"useDefineForClassFields": true,
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"],
"baseUrl": ".",
"allowJs": true,
"paths": {
"@/*": ["src/*"]
},
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
"allowSyntheticDefaultImports": true /* 允许默认导入 */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
"types": ["./node_modules/element-plus/global"],
"typeRoots": [
"./node_modules/@types/",
"src/types"
] /* 指定多个文件夹,这些文件夹的作用类似于 './node_modules/@types'. */
},
"include": ["src/**/*.ts", "src/**/*.vue", "src/types/**/*.d.ts"],
"exclude": ["node_modules", "dist", "**/*.js", "./jenkins"]
}
回复
1个回答

test
2024-07-05
volar 插件版本bug 回退到1.2.0版本即可 等后续插件作者解决后会发新版本
1.可以点卸载后再重新搜索安装 看是不是1.2.0版本 我就是这么解决了2.可以右键点击安装另一个版本https://marketplace.visualstudio.com/_apis/public/gallery/pub...
回复

适合作为回答的
- 经过验证的有效解决办法
- 自己的经验指引,对解决问题有帮助
- 遵循 Markdown 语法排版,代码语义正确
不该作为回答的
- 询问内容细节或回复楼层
- 与题目无关的内容
- “赞”“顶”“同问”“看手册”“解决了没”等毫无意义的内容