vscode code definition jump, vue file jump

vscode code definition jump

Recently, I was complained by the supervisor. Webstorm can directly click on the method to jump to the defined file. Why doesn’t vscode work?

It is said on the Internet that ts is supported, but js is not

In fact, js can also be used. The reason why it cannot be found across files is because there is no connection established.

  1. Create a new jsconfig.json in the project root directory

  2. Enter configuration content

jsconfig.json

{
    "compilerOptions": {
        "baseUrl": "./", 
        "paths": {
          "@/*": ["src/*"] //别名:这个根据具体项目配置
        }
    },
    "exclude": [
        "node_modules"
    ]
}

After completing the above two steps, you can jump to js file definition

  1. If you need to jump to the .vue file, you need to install the plugin Vue Peek

Guess you like

Origin blog.csdn.net/weixin_42657666/article/details/126973315