🌈 style(eslint): add eslint rules
This commit is contained in:
@@ -1,25 +1,22 @@
|
||||
import { View } from "@tarojs/components"
|
||||
import { memo, useMemo } from "react"
|
||||
import style from './index.module.scss'
|
||||
export default memo(({width=60, color='#6190e8'}:{width?:number, color?:string}) => {
|
||||
const styleObj = useMemo(() => {
|
||||
let obj = {}
|
||||
if(width > 0)
|
||||
obj = {width: width + 'rpx', height:width + 'rpx'}
|
||||
if(color)
|
||||
obj = {...obj, borderColor: color+' transparent transparent'}
|
||||
return obj
|
||||
|
||||
}, [width, color])
|
||||
console.log('loading:::')
|
||||
return (
|
||||
<View className={style.loading}
|
||||
style={styleObj}
|
||||
>
|
||||
<View style={styleObj} className={style.loading__ring}></View>
|
||||
<View style={styleObj} className={style.loading__ring}></View>
|
||||
<View style={styleObj} className={style.loading__ring}></View>
|
||||
</View>
|
||||
)
|
||||
|
||||
})
|
||||
import { View } from '@tarojs/components'
|
||||
import { memo, useMemo } from 'react'
|
||||
import style from './index.module.scss'
|
||||
|
||||
export default memo(({ width = 60, color = '#6190e8' }: { width?: number; color?: string }) => {
|
||||
const styleObj = useMemo(() => {
|
||||
let obj = {}
|
||||
if (width > 0) { obj = { width: `${width}rpx`, height: `${width}rpx` } }
|
||||
if (color) { obj = { ...obj, borderColor: `${color} transparent transparent` } }
|
||||
return obj
|
||||
}, [width, color])
|
||||
console.log('loading:::')
|
||||
return (
|
||||
<View className={style.loading}
|
||||
style={styleObj}
|
||||
>
|
||||
<View style={styleObj} className={style.loading__ring}></View>
|
||||
<View style={styleObj} className={style.loading__ring}></View>
|
||||
<View style={styleObj} className={style.loading__ring}></View>
|
||||
</View>
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user