fix: table loop problem, close #5543

pull/5550/head
tangjinzhou 2022-04-26 11:08:18 +08:00
parent 04752880af
commit cb6d0bd411
1 changed files with 11 additions and 4 deletions

View File

@ -508,10 +508,17 @@ export default defineComponent<TableProps<DefaultRecordType>>({
});
onUpdated(() => {
nextTick(() => {
scrollBodySizeInfo.value = {
scrollWidth: scrollBodyRef.value?.scrollWidth || 0,
clientWidth: scrollBodyRef.value?.clientWidth || 0,
};
const scrollWidth = scrollBodyRef.value?.scrollWidth || 0;
const clientWidth = scrollBodyRef.value?.clientWidth || 0;
if (
scrollBodySizeInfo.value.scrollWidth !== scrollWidth ||
scrollBodySizeInfo.value.clientWidth !== clientWidth
) {
scrollBodySizeInfo.value = {
scrollWidth,
clientWidth,
};
}
});
});