Skip to content

Conversation

@wangshunnn
Copy link
Collaborator

Fix (RN)

  • mpx2rn mpx-view 组件通过 style/wx:style 属性传递(比如 <view style="background-size: 100rpx 100rpx;" />),带单位的 background width hight 不会被自动转换处理,导致运行时 bug。

@wangshunnn wangshunnn added the platform:RN Mpx 跨端输出 RN label Dec 12, 2025

return sizeList
// 模板 style 属性传入时, 需要额外转换处理单位 px/rpx/vh
return global.__formatValue(val) as DimensionValue
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backgroundposition也存在类似问题吧,也可以举一反三检查下其他地方有没有类似问题

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

background-position 添加了类似处理,其他属性目前看起来 ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform:RN Mpx 跨端输出 RN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants