Skip to content

Commit

Permalink
fix: 从 docusaurus 层面解决 pxTransform 问题
Browse files Browse the repository at this point in the history
  • Loading branch information
cncolder committed Jun 10, 2020
1 parent 74755fa commit 9e82004
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ export interface LoadingProps {
color?: string | number
}

const px = Taro.pxTransform || ((p: number) => `${p}px`)

export const Loading: React.FC<LoadingProps> = (props) => {
export const Loading: React.FC<LoadingProps> = props => {
const { color, size = '' } = props

const loadingSize = typeof size === 'string' ? size : String(size)
const sizeStyle = {
width: size ? `${px(parseInt(loadingSize))}` : '',
height: size ? `${px(parseInt(loadingSize))}` : '',
width: size ? `${Taro.pxTransform(parseInt(loadingSize))}` : '',
height: size ? `${Taro.pxTransform(parseInt(loadingSize))}` : '',
}
const colorStyle = {
border: color ? `1px solid ${color}` : '',
Expand Down

0 comments on commit 9e82004

Please sign in to comment.