fix: 分页组件total为undefined时不显示
This commit is contained in:
parent
91bf1da808
commit
71f385f0f4
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue