@17681880207 如果 vscode 使用的是`Vue - Official`插件,那么需要在项目下新增`tsconfig.json`,配置之后跳转丝滑。配置参考如下。
```json
{
"compilerOptions": {
"target": "ESNext",
"lib": ["DOM", "ESNext"],
"baseUrl": ".",
"module": "ESNext",
"moduleResolution": "node",
"paths": {
"@/*": ["src/*"]
},
"resolveJsonModule": true,
"types": ["vite/client"],
"allowJs": true,
"strict": true,
"strictNullChecks": true,
"noUnusedLocals": true,
"outDir": "./dist",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": false,
"skipLibCheck": true
},
"exclude": ["dist", "node_modules"]
}
``` |