vue cli3 项目目录配置别名

vue cli3 项目目录配置别名

module.exports = {
  configureWebpack: {
    resolve: {
      alias: {
        'assets': '@/assets',
        'common': '@/common',
        'components': '@/components',
        'network': '@/network',
        'views': '@/views',
      }
    }
  }
}

使用:

vue cli3 项目目录配置别名

另外需要注意的是如果是在HTML中使用需要加个 ~ 波浪线即:

 vue cli3 项目目录配置别名

vue cli3 项目目录配置别名

.editorconfig文件夹下


root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

 

相关文章:

  • 2022-12-23
  • 2021-09-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2021-12-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2023-03-14
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案