fix: improve pagination

This commit is contained in:
fantasticit 2022-03-18 17:18:13 +08:00
parent 6fba1e4394
commit 3826ec4a78
1 changed files with 6 additions and 3 deletions

View File

@ -18,6 +18,7 @@ const grid = {
}; };
const { Title } = Typography; const { Title } = Typography;
const PAGESIZE = 12;
const Page: NextPage = () => { const Page: NextPage = () => {
const { data, loading, error, setPage } = useAllPublicWikis(); const { data, loading, error, setPage } = useAllPublicWikis();
@ -59,9 +60,11 @@ const Page: NextPage = () => {
)} )}
emptyContent={<Empty message={'暂无数据'} />} emptyContent={<Empty message={'暂无数据'} />}
/> />
{data.total > PAGESIZE && (
<div style={{ display: 'flex', justifyContent: 'center' }}> <div style={{ display: 'flex', justifyContent: 'center' }}>
<Pagination total={data.total} pageSize={12} onPageChange={setPage} /> <Pagination total={data.total} pageSize={PAGESIZE} onPageChange={setPage} />
</div> </div>
)}
</> </>
)} )}
/> />