Skip to content

Commit

Permalink
Merge branch 'dev-harmony' into dev-harmony-optimize-rn
Browse files Browse the repository at this point in the history
  • Loading branch information
irisSong authored Jul 22, 2024
2 parents e853f33 + eb2d633 commit c12046e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dongdesign/components",
"version": "1.0.0-alpha.0",
"version": "1.0.1",
"style": "dist/style.css",
"main": "dist/nutui.react.umd.js",
"module": "dist/es/packages/nutui.react.build.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/nutui-taro-demo-rn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@
"resolutions": {
"react-native-webview": "13.6.3"
}
}
}
6 changes: 4 additions & 2 deletions src/utils/px-transform.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { pxTransform as transform } from '@tarojs/taro'
import { harmony, rn } from './platform-taro'

export default function pxTransform(value: number) {
if (harmony() || rn()) return transform(value)
export default function pxTransform(value: number, radix?: number): any {
// @ts-ignore
if (harmony()) return transform(value, radix || 375)
if (rn()) return value
return `${value}px`
}

0 comments on commit c12046e

Please sign in to comment.