导航

    Taro 社区

    Taro

    • 注册
    • 登录
    • 搜索
    • 版块
    • 最新
    • 话题
    • 热门
    • 群组
    1. 主页
    2. duxiuxiu
    D
    • 资料
    • 关注
    • 粉丝
    • 主题
    • 帖子
    • 最佳
    • 群组

    duxiuxiu

    @duxiuxiu

    0
    声望
    4
    帖子
    261
    资料浏览
    0
    粉丝
    0
    关注
    注册时间 最后登录
    网站 blog.csdn.net/m0_37148591

    duxiuxiu 关注

    duxiuxiu 发布的帖子

    • 使用 ts + taro 做小程序开发,引入的taro 组件 ts 语法检查报错

      代码与报错如下图所示
      替代文字

      发布在 Taro
      D
      duxiuxiu
    • export default { Com } import { Com } from 以及 export Com 居然在使用上有问题
      export default  {
        Com
      };
      
      // 然后
      
      import {Com} from './components';
      
      

      居然报错 " './components/index' does not contain an export named 'Com'.

      以前 ES Modules 中常见的用法,居然在 taro 中报错 "@tarojs/taro": "2.1.5",

      然后直接写 export Com; 居然也报错

      发布在 提 Bug
      D
      duxiuxiu
    • RE: input 无法改变样式

      @Taro-小助手-honly 没有其它的解决方案了吗?这个解决方案看起来很勉强

      发布在 Taro
      D
      duxiuxiu
    • RE: imageUrlLoaderOption 的 publicPath 配置项不生效

      仔细看一下 miniimageurlloaderoption 的说明,taro 默认使用的是 url-loader ,url-loader 就是将资源处理成 base64 直接放在代码中的,并没有将资源提出来,你设置的 publicPath 不是 url-loader 的配置项当然不会生效,你应该在 fallback 中配置 file-loaer 就能达成你要的效果了,配置类似于这样

        mini: {
          /** 
           * 文件大小超过 0 字节对应文件会被处理到 name 属性所指定的地址中
           * 文件大小小于 0 字节会被处理成 base64 直接嵌入到代码中
           */
          imageUrlLoaderOption:{
            limit: 0, // 单位为 byte 字节
            fallback: {
                loader: 'file-loader',
                options: {
                    outputPath: 'static/images',
                    name: '[name].[hash:7].[ext]',
                    publicPath:'',
                    // publicPath:'http://xxx.com/',
                },
            }
          }
        },
      
      发布在 Taro
      D
      duxiuxiu