feat: first commit

This commit is contained in:
eleanor.mao
2025-03-31 22:34:22 +08:00
commit d25187c9c8
390 changed files with 57031 additions and 0 deletions

View File

@ -0,0 +1,33 @@
import { List, Loading } from '@taroify/core';
import { ReactNode } from 'react';
import './index.less';
interface IPlaceholderProps {
hasMore: boolean;
loadingMore: boolean;
loadMoreError: boolean;
noMoreText: ReactNode;
loadMoreErrorText: ReactNode;
}
function ListPlaceholder(props: Partial<IPlaceholderProps>) {
const { hasMore, loadingMore, loadMoreError, noMoreText, loadMoreErrorText } = props;
let content: ReactNode = '';
if (loadingMore) {
content = <Loading>...</Loading>;
} else if (loadMoreError) {
content = loadMoreErrorText ?? '加载失败,请下拉刷新重试';
} else if (!hasMore) {
content = noMoreText ?? '没有更多了';
}
if (!content) {
return null;
}
return <List.Placeholder>{content}</List.Placeholder>;
}
export default ListPlaceholder;