1***@qq.com
1***@qq.com
  • 发布:2019-03-24 18:28
  • 更新:2021-06-18 09:48
  • 阅读:8814

uniapp访问路径能否设置别名?

分类:uni-app

配置目录别名隐藏目录结构你们都没有这个需求吗?还是有别的解决办法呢?(●°u°●)​ 」

2019-03-24 18:28 负责人:无 分享
已邀请:
c***@163.com

c***@163.com

同求怎么配置

1***@qq.com

1***@qq.com (作者) - 90后码农

写个json对应文件目录,改文件名字

Joyce80

Joyce80 - 拓荒者!!!

同求方法

1***@163.com

1***@163.com

同求啊~~~~找了很久

1***@qq.com

1***@qq.com - 827915

vue.config.js

const path=require('path')  
module.exports = {  
    // 配置路径别名  
    configureWebpack: (config) => {  
        config.resolve.alias['@']=path.resolve(__dirname,"./");  
        config.resolve.alias['@store']=path.resolve(__dirname,"./store");  
        config.resolve.alias['@minxin']=path.resolve(__dirname,"./mixins");  
        config.resolve.alias['@minxins']=path.resolve(__dirname,"./mixins");  
        config.resolve.alias['@u']=path.resolve(__dirname,"./utils");  
        config.resolve.alias['@util']=path.resolve(__dirname,"./utils");  
        config.resolve.alias['@utils']=path.resolve(__dirname,"./utils");  
        config.resolve.alias['@d']=path.resolve(__dirname,"./directives");  
        config.resolve.alias['@c']=path.resolve(__dirname,"./directives");  
        config.resolve.alias['@img']=path.resolve(__dirname,"./assets/img");  
        config.resolve.alias['@imgs']=path.resolve(__dirname,"./assets/img");  
        config.resolve.alias['img']=path.resolve(__dirname,"./assets/img");  
        config.resolve.alias['imgs']=path.resolve(__dirname,"./assets/img");  
        config.resolve.alias['c']=path.resolve(__dirname,"./components");  
        config.resolve.alias['d']=path.resolve(__dirname,"./directives");  
        config.resolve.alias['u']=path.resolve(__dirname,"./utils");  
        config.resolve.alias['store']=path.resolve(__dirname,"./store");  
        config.resolve.alias['minxins']=path.resolve(__dirname,"./mixins");  
        config.resolve.alias['minxin']=path.resolve(__dirname,"./mixins");  
        config.resolve.alias['minxin']=path.resolve(__dirname,"./mixins");  
    },  
    productionSourceMap: false,  
}  
  • 1***@qq.com

    新建的uniapp项目为什么没有这个文件,直接@图片就有效,加上这个文件改了怎么还报错啊Module not found: Error: Can't resolve '@/logo.png'

    2021-06-24 18:21

9***@qq.com

9***@qq.com

同求啊

hhyang

hhyang - 如有问题,请添加QQ1606726660 备注付费咨询

该问题目前已经被锁定, 无法添加新回复