import {ScrollView, Text} from '@tarojs/components'; import {useListEvent, useRefreshState, useScrollControl} from './hooks'; import {Empty} from '@components'; import classNames from 'classnames'; const Refresh = function ({ isRefreshing, onRefresh, onLoading, isLoading, children, style, className, background, refreshStyle, noMore, empty, emptyMsg, emptyClassName, emptyChildren, endClassName, }) { const [topRef, onScroll] = useScrollControl(); const refreshState = useRefreshState(topRef, isRefreshing); const {onListRefresh, onListLoading} = useListEvent({ isLoading, isRefreshing: refreshState, onRefresh, onLoading, noMore, }); return ( {empty ? ( {emptyChildren} ) : ( children )} 正在加载中 已经到底了~~ ); }; export default Refresh;