rpx2px
This commit is contained in:
8
unit/rpx2px.js
Normal file
8
unit/rpx2px.js
Normal file
@ -0,0 +1,8 @@
|
||||
import { isNumber } from 'lodash-es';
|
||||
|
||||
export const rpx2px = (rpx) => {
|
||||
if (!isNumber(rpx)) return 0;
|
||||
const screenWidth = uni.getSystemInfoSync().screenWidth;
|
||||
const result = (screenWidth * rpx) / 750
|
||||
return result;
|
||||
}
|
Reference in New Issue
Block a user