Skip to content

Commit cb6d0bd

Browse files
committed
fix: table loop problem, close #5543
1 parent 0475288 commit cb6d0bd

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

components/vc-table/Table.tsx

+11-4
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,17 @@ export default defineComponent<TableProps<DefaultRecordType>>({
508508
});
509509
onUpdated(() => {
510510
nextTick(() => {
511-
scrollBodySizeInfo.value = {
512-
scrollWidth: scrollBodyRef.value?.scrollWidth || 0,
513-
clientWidth: scrollBodyRef.value?.clientWidth || 0,
514-
};
511+
const scrollWidth = scrollBodyRef.value?.scrollWidth || 0;
512+
const clientWidth = scrollBodyRef.value?.clientWidth || 0;
513+
if (
514+
scrollBodySizeInfo.value.scrollWidth !== scrollWidth ||
515+
scrollBodySizeInfo.value.clientWidth !== clientWidth
516+
) {
517+
scrollBodySizeInfo.value = {
518+
scrollWidth,
519+
clientWidth,
520+
};
521+
}
515522
});
516523
});
517524

0 commit comments

Comments
 (0)