refactor: 不分页表格逻辑调整

This commit is contained in:
RubyLiu 2023-11-10 14:43:28 +08:00 committed by Craftsman
parent 4d02b544bd
commit c3b2d18a06
1 changed files with 11 additions and 7 deletions

View File

@ -381,13 +381,17 @@ export default function useTableProps<T>(
watchEffect(() => { watchEffect(() => {
const { heightUsed, showPagination, selectedKeys, msPagination } = propsRes.value; const { heightUsed, showPagination, selectedKeys, msPagination } = propsRes.value;
const { pageSize, total } = msPagination as Pagination; let hasFooterAction = false;
/* if (showPagination) {
* const { pageSize, total } = msPagination as Pagination;
* 1. /*
* 2. *
*/ * 1.
const hasFooterAction = (showPagination && total > pageSize) || selectedKeys.size > 0; * 2.
*/
hasFooterAction = total > pageSize || selectedKeys.size > 0;
}
const currentY = const currentY =
appStore.innerHeight - (heightUsed || defaultHeightUsed) + (hasFooterAction ? 0 : footerActionWrapHeight); appStore.innerHeight - (heightUsed || defaultHeightUsed) + (hasFooterAction ? 0 : footerActionWrapHeight);
propsRes.value.showFooterActionWrap = hasFooterAction; propsRes.value.showFooterActionWrap = hasFooterAction;