問題描述:
新搭建的vue3+ts項目,在vscode中打開,已經(jīng)安裝的的依賴文件也會提示紅線
如下圖:
在vscode中的tsconfig.json修改配置如下:
代碼如下:文章來源地址http://www.zghlxwxcb.cn/news/detail-822842.html
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
// "types": ["element-plus/global"],
/* Bundler mode */
"moduleResolution": "node",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"baseUrl": ".",
"allowJs": true,
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"types": ["vite/client", "element-plus/global","unplugin-icons/types/vue"],
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
"allowSyntheticDefaultImports": true /* 允許默認(rèn)導(dǎo)入 */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"references": [{ "path": "./tsconfig.node.json" }]
}
文章來源:http://www.zghlxwxcb.cn/news/detail-822842.html
到了這里,關(guān)于vue3+ts項目在vscode中爆紅提示修復(fù)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!