导航

    Taro 社区

    Taro

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

    jd_5a1b5943c27fb

    @jd_5a1b5943c27fb

    0
    声望
    12
    帖子
    909
    资料浏览
    0
    粉丝
    0
    关注
    注册时间 最后登录

    jd_5a1b5943c27fb 关注

    jd_5a1b5943c27fb 发布的帖子

    • h5用taro怎么实现PickerView的功能

      如题

      发布在 提 Bug
      J
      jd_5a1b5943c27fb
    • RE: npm run dev 启动报错

      你这是有安装包没下载下来啊,cnpm i 试一下

      发布在 微信小程序
      J
      jd_5a1b5943c27fb
    • 基于taro自己开发第三方ui库, 打包出的代码发布成npm包,在小程序中能够正常展示,在H5中单位没有适配,还是px而不是rem

      这个是config的配置

      if (process.env.TARO_BUILD_TYPE === "ui") {
        Object.assign(config.h5, {
          enableSourceMap: false,
          enableExtract: false,
          enableDll: false
        });
        config.h5.webpackChain = chain => {
          chain.plugins.delete("htmlWebpackPlugin");
          chain.plugins.delete("addAssetHtmlWebpackPlugin");
          chain.merge({
            output: {
              path: path.join(process.cwd(), "dist", "h5"),
              filename: "index.js",
              libraryTarget: "umd",
              library: "ui-images"
            },
            externals: {
              nervjs: "commonjs2 nervjs",
              classnames: "commonjs2 classnames",
              "@tarojs/components": "commonjs2 @tarojs/components",
              "@tarojs/taro-h5": "commonjs2 @tarojs/taro-h5",
              weui: "commonjs2 weui"
            },
            plugin: {
              extractCSS: {
                plugin: MiniCssExtractPlugin,
              }
            }
          });
        };
      }
      const config = {
        projectName: "project",
        date: "2020-4-27",
        designWidth: 750,
        deviceRatio: {
          "640": 2.34 / 2,
          "750": 1,
          "828": 1.81 / 2
        },
        sourceRoot: "src",
        outputRoot: "dist",
        babel: {
          sourceMap: true,
          presets: [
            [
              "env",
              {
                modules: false
              }
            ]
          ],
          plugins: [
            "transform-decorators-legacy",
            "transform-class-properties",
            "transform-object-rest-spread",
            [
              "transform-runtime",
              {
                helpers: false,
                polyfill: false,
                regenerator: true,
                moduleName: "babel-runtime"
              }
            ]
          ]
        },
        plugins: [],
        defineConstants: {},
        mini: {
          postcss: {
            pxtransform: {
              enable: true,
              config: {}
            },
            url: {
              enable: true,
              config: {
                limit: 10240 // 设定转换尺寸上限
              }
            },
            cssModules: {
              enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
              config: {
                namingPattern: "module", // 转换模式,取值为 global/module
                generateScopedName: "[name]__[local]___[hash:base64:5]"
              }
            }
          }
        },
        h5: {
          publicPath: "/",
          staticDirectory: "static",
          postcss: {
            autoprefixer: {
              enable: true,
              config: {
                browsers: ["last 3 versions", "Android >= 4.1", "ios >= 8"]
              }
            },
            cssModules: {
              enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
              config: {
                namingPattern: "module", // 转换模式,取值为 global/module
                generateScopedName: "[name]__[local]___[hash:base64:5]"
              }
            }
          }
        }
      };
      
      module.exports = function(merge) {
        if (process.env.NODE_ENV === "development") {
          return merge({}, config, require("./dev"));
        }
        return merge({}, config, require("./prod"));
      };
      
      
      发布在 提 Bug
      J
      jd_5a1b5943c27fb
    • 基于taro开发第三方ui库。执行taro build --ui,,, 发现dist没有图片文件夹,急求答案!

      页面引用图片了,版本是2.1.6

      11300791-c950-48b5-9aa3-965b5bc01330-image.png

      de5d45a9-1398-4a6e-90f9-01b16381c5b0-image.png

      发布在 提 Bug
      J
      jd_5a1b5943c27fb
    • RE: taro打包成小程序以后,点击事件不是bindtap,而是bindonclick

      @Taro-小助手-honly taro开发的组建,能用到原生开发的微信小程序和react开发的H5上面吗

      发布在 微信小程序
      J
      jd_5a1b5943c27fb
    • RE: taro打包成小程序以后,点击事件不是bindtap,而是bindonclick

      @Taro-小助手-honly Taro v2.1.5

      发布在 微信小程序
      J
      jd_5a1b5943c27fb
    • RE: 想问下各位大佬 能不能把taro生成的小程序代码 放到原生小程序里面用呢 因为不能把原生转成taro再二次开发

      @荃啊荃啊荃 原生h5可以吗?现在就是想把taro打包的H5组建拿到react开发的H5上使用,现在的问题是打包过后都是压缩过的

      发布在 微信小程序
      J
      jd_5a1b5943c27fb
    • RE: 想问下各位大佬 能不能把taro生成的小程序代码 放到原生小程序里面用呢 因为不能把原生转成taro再二次开发

      @18624076077_p 老哥怎么解决的

      发布在 微信小程序
      J
      jd_5a1b5943c27fb
    • 用taro开发的组建打包以后,有什么方法可以在react开发的H5上复用吗?

      如题

      发布在 微信小程序
      J
      jd_5a1b5943c27fb