Skip to content

Commit

Permalink
fix(divider): 解决单位编译不正确的问题 #1725
Browse files Browse the repository at this point in the history
  • Loading branch information
robinv8 committed Jan 23, 2024
1 parent 8927199 commit 3243e13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 2 additions & 7 deletions packages/taro-ui/rn/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,8 @@ function handleTouchScroll(flag: any): void {

function pxTransform(size: number): string {
if (!size) return ''
const designWidth = 750
const deviceRatio = {
640: 2.34 / 2,
750: 1,
828: 1.81 / 2
}
return `${size / deviceRatio[designWidth]}rpx`

return Taro.pxTransform(size)
}

function objectToString(style: object | string): string {
Expand Down
9 changes: 2 additions & 7 deletions packages/taro-ui/src/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,8 @@ function handleTouchScroll(flag: any): void {

function pxTransform(size: number): string {
if (!size) return ''
const designWidth = 750
const deviceRatio = {
640: 2.34 / 2,
750: 1,
828: 1.81 / 2
}
return `${size / deviceRatio[designWidth]}rpx`

return Taro.pxTransform(size)
}

function objectToString(style: object | string): string {
Expand Down

0 comments on commit 3243e13

Please sign in to comment.