idea vue项目设置路径别名(适用于@vue/cli 高版本)

 打开设置

File > Settings > Languages & Frameworks > JavaScript > Webpack

设置webpack configuration file

C:\Develop\vue-mall-pc\node_modules\@vue\cli-service\webpack.config.js

注意根据自己的项目路径选择修改

idea vue项目设置路径别名(适用于@vue/cli 高版本)_第1张图片

vue.config.js 路径别名设置 configureWebpack

configureWebpack: {
    resolve: {
    alias: {
        "@": resolve("src"),
        "@i": resolve("src/api"),
        "@c": resolve("src/components"),
        "@a": resolve("src/assets"),
        "@s": resolve("src/styles"),
        "@u": resolve("src/utils"),
        "@v": resolve("src/views")
        }
    }
}

idea 提示 Cannot find declaration to go to

你可能感兴趣的:(Idea,Vue)