Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

升级 2.2.14 后尺寸出错 #7819

Closed
tommytroylin opened this issue Oct 12, 2020 · 5 comments
Closed

升级 2.2.14 后尺寸出错 #7819

tommytroylin opened this issue Oct 12, 2020 · 5 comments
Labels
F-react Framework - React T-alipay Target - 编译到支付宝小程序 V-2 Version - 2.x

Comments

@tommytroylin
Copy link

相关平台

支付宝小程序

小程序基础库: 1.14.0
使用框架: React

复现步骤

不修改任何代码和配置。从 2.2.13 升级到 2.2.14 之后。各元素尺寸出现问题。

期望结果

尺寸计算正常

实际结果

尺寸计算有误

环境信息

正常的环境:

Taro CLI 2.2.13 environment info:
    System:
      OS: macOS 10.15.7
      Shell: 5.8 - /usr/local/bin/zsh
    Binaries:
      Node: 10.20.1 - ~/.nvm/versions/node/v10.20.1/bin/node
      npm: 6.14.8 - ~/.nvm/versions/node/v10.20.1/bin/npm
    npmPackages:
      @tarojs/cli: 2.2.13 => 2.2.13 
      @tarojs/components: 2.2.13 => 2.2.13 
      @tarojs/mini-runner: 2.2.13 => 2.2.13 
      @tarojs/plugin-babel: 2.2.13 => 2.2.13 
      @tarojs/plugin-csso: 2.2.13 => 2.2.13 
      @tarojs/plugin-less: 2.2.13 => 2.2.13 
      @tarojs/plugin-terser: 2.2.13 => 2.2.13 
      @tarojs/redux: 2.2.13 => 2.2.13 
      @tarojs/taro: 2.2.13 => 2.2.13 
      @tarojs/taro-alipay: 2.2.13 => 2.2.13 
      @tarojs/webpack-runner: 2.2.13 => 2.2.13 
      eslint-config-taro: 2.2.13 => 2.2.13 
      eslint-plugin-taro: 2.2.13 => 2.2.13

异常环境为
2.2.14

补充信息

怀疑与 #7644 合并有关

@taro-bot2 taro-bot2 bot added F-react Framework - React T-alipay Target - 编译到支付宝小程序 V-2 Version - 2.x labels Oct 12, 2020
@luckyadam
Copy link
Member

你的设计稿是什么尺寸的

@tommytroylin
Copy link
Author

375px

配置是:

designWidth: 375,
  deviceRatio: {
    '375': 1 / 2,
    '640': 2.34 / 2,
    '750': 1,
    '828': 1.81 / 2,
  },

@luckyadam
Copy link
Member

deviceRatio: {
'375': 2 / 1,
'640': 2.34 / 2,
'750': 1,
'828': 1.81 / 2,
}

调整一下配置吧,之前的是有问题的

@tommytroylin
Copy link
Author

@luckyadam OK 试过了。已经正常了。感谢支持

看上去是个文档问题。旧版本的文档写错了。新的 3.0.9 文档正常
image

https://taro-docs.jd.com/taro/docs/2.2.13/size

@luckyadam
Copy link
Member

@luckyadam OK 试过了。已经正常了。感谢支持

看上去是个文档问题。旧版本的文档写错了。新的 3.0.9 文档正常
image

https://taro-docs.jd.com/taro/docs/2.2.13/size

嗯嗯,文档我来调整下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-alipay Target - 编译到支付宝小程序 V-2 Version - 2.x
Projects
None yet
Development

No branches or pull requests

3 participants