🌈 style(eslint): add eslint rules
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { View, Text } from '@tarojs/components'
|
||||
import { FC } from 'react'
|
||||
import { Text, View } from '@tarojs/components'
|
||||
import type { FC } from 'react'
|
||||
import Iconfont from '../iconfont/iconfont'
|
||||
import LoadingCard from '../loadingCard/index'
|
||||
import styles from './index.module.scss'
|
||||
@@ -17,7 +17,7 @@ interface LoadMorePropsType extends LoadMoreEvent {
|
||||
noMoreText?: string
|
||||
}
|
||||
|
||||
const LoadMore: FC<LoadMorePropsType> = props => {
|
||||
const LoadMore: FC<LoadMorePropsType> = (props) => {
|
||||
const { status, moreText = '查看更多', loadingText = '加载中', noMoreText = '没有更多', onClick } = props
|
||||
|
||||
const handleShowMore = () => {
|
||||
@@ -27,14 +27,16 @@ const LoadMore: FC<LoadMorePropsType> = props => {
|
||||
let component: JSX.Element | null = null
|
||||
if (status === 'loading') {
|
||||
component = <LoadingCard title={loadingText}></LoadingCard>
|
||||
} else if (status === 'more') {
|
||||
}
|
||||
else if (status === 'more') {
|
||||
component = (
|
||||
<View className='flex-row' onClick={handleShowMore}>
|
||||
<View className="flex-row" onClick={handleShowMore}>
|
||||
<Text style={{ marginRight: '5px' }}>{moreText}</Text>
|
||||
<Iconfont name='icon-zhankai' size={32}></Iconfont>
|
||||
<Iconfont name="icon-zhankai" size={32}></Iconfont>
|
||||
</View>
|
||||
)
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
component = <Text>{noMoreText}</Text>
|
||||
}
|
||||
return <View className={styles.loadMore}>{component}</View>
|
||||
|
||||
Reference in New Issue
Block a user