VSCode 使用import导入js/vue等时添加智能提示,并可跳转到定义
如:
js
// 按住ctrl+鼠标点击getDataList, 可以跳转到homeApi.js中的定义位置
import { getDataList } from '@/api/homeApi.js'
- 安装
Vue Peek
插件 - 在项目根目录下新建
jsconfig.json
文件
json
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
}
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
- 重启 VSCode 即可