问题描述:
在编辑器代码上Ctrl+左键没有下划线,不能跳转
原因:
是因为项目根目录中没有jsconfig.json,如果使用ts是没有tsconfig.json
解决方法:
在根目录下添加jsconfig.json或tsconfig.json文件,内容如下配置
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
"target": "ES6",
"allowSyntheticDefaultImports": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
如果是.vue文件的跳转,需安装插件 Vue Peek
最后重启vscode。