<ComponentName>标签上的IntelliJ CMD/CTRL + LMB在VueJS项目中不起作用

Xqu*_*ick 5 intellij-idea vue.js

我有几个用VueJS编写的项目.我希望能够使用CMD/ CTRL+左键单击该元素,从HTML模板元素导航到它的component.vue文件.

我的观察是,当项目变得更大时,这个组件的导航停止工作(CMD/ CTRL+ LMB什么都不做),我不知道为什么.

你碰巧知道这个问题的解决方案吗?

Xqu*_*ick 0

所以我发现了问题所在。它与您导出组件的方式有关。

在职的

export default {
  name: 'ComponentA',
};
Run Code Online (Sandbox Code Playgroud)

破碎的

const componentA = {
  name: 'ComponentA',
}
export default componentA;
Run Code Online (Sandbox Code Playgroud)

为了使CTRL+LMB导航在 Vue 模板中工作,ComponentA 和导入它的组件都需要采用“正确”的格式。