这里写自定义目录标题
jsconfig.json
vue项目
import notic from “@/components/notic”;(crtl+鼠标)无法跳转到notic页面
解决方案:在项目根目录创建 jsconfig.json文件 然后重启vscode开发工具
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
]
},
"target": "ES6",
"module": "commonjs",
"allowSyntheticDefaultImports": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules"
]
}
方案二
安装 vetur 和 vue-helper 两个插件
打开设置 --> 扩展 --> vue helper, 然后在右边找到在 settings.json 中编辑,点击,添加或修改下面的配置
"vue-helper.alias": {
"@": "src"
},
"vue-helper.componentPrefix": {
"alias": "@",
"path": "src"
}
重启vscode