We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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.14.3 使用框架: React
<View style={{ height: Taro.pxTransform(10) }}
小程序和h5转码之后的单位分别为rpx和rem
转码之后的单位都为px
Taro v3.1.0-beta.4 Taro CLI 3.1.0-beta.4 environment info: System: OS: Windows 10 Binaries: Node: 14.15.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.10 - C:\Program Files\nodejs\yarn.CMD npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
The text was updated successfully, but these errors were encountered:
@taro -bot2 是所有小程序转换都有问题吗??
Sorry, something went wrong.
@Mar-er 复现不了,你在开发者工具看到的 px 是 rpx 计算后的实际值,style 其实是设置正确了 rpx 的。
export default class Index extends Component { render () { console.log('Taro.pxTransform(10): ', Taro.pxTransform(10, 375)) return ( <View> <View style={{ height: Taro.pxTransform(10, 375) }} /> </View> ) } }
小程序:
H5:
No branches or pull requests
相关平台
微信小程序
小程序基础库: 2.14.3
使用框架: React
复现步骤
<View style={{
height: Taro.pxTransform(10)
}}
期望结果
小程序和h5转码之后的单位分别为rpx和rem
实际结果
转码之后的单位都为px
环境信息
The text was updated successfully, but these errors were encountered: