fix: 分页组件total为undefined时不显示

This commit is contained in:
lxy 2025-12-17 16:37:28 +08:00
parent 91bf1da808
commit 71f385f0f4
2 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ MiddleSelect.Option = Select.Option;
export default function Render(props) {
const { style, className, oakPagination, oakFullpath, newTotal, showQuickJumper, showSizeChanger, size, showTotal, showTitle, } = props.data;
const { t, setPageSize, setCurrentPage } = props.methods;
const { pageSize, total, currentPage, more, count, getTotal } = oakPagination || {};
const { pageSize = 0, total = 0, currentPage = 1, more, count, getTotal } = oakPagination || {};
const paginationRef = useRef(null);
const [internalInputVal, setInternalInputVal] = useState(currentPage);
useEffect(() => {
@ -28,7 +28,7 @@ export default function Render(props) {
if (!oakPagination) {
return null;
}
if (total === 0) {
if (!total) {
return null;
}
const prefixCls = 'rc-pagination';

View File

@ -60,7 +60,7 @@ export default function Render(
showTitle,
} = props.data;
const { t, setPageSize, setCurrentPage } = props.methods;
const { pageSize, total, currentPage, more, count, getTotal } = oakPagination || {};
const { pageSize = 0, total = 0, currentPage = 1, more, count, getTotal } = oakPagination || {};
const paginationRef = useRef<HTMLUListElement>(null);
const [internalInputVal, setInternalInputVal] = useState(currentPage);
@ -71,7 +71,7 @@ export default function Render(
if (!oakPagination) {
return null;
}
if (total === 0) {
if (!total) {
return null
}