@@ -33,6 +33,7 @@ import useSticky from './hooks/useSticky';
3333import FixedHolder from './FixedHolder' ;
3434import type { CSSProperties } from 'vue' ;
3535import {
36+ onUpdated ,
3637 computed ,
3738 defineComponent ,
3839 nextTick ,
@@ -327,6 +328,10 @@ export default defineComponent<TableProps<DefaultRecordType>>({
327328 const fullTableRef = ref < HTMLDivElement > ( ) ;
328329 const scrollHeaderRef = ref < HTMLDivElement > ( ) ;
329330 const scrollBodyRef = ref < HTMLDivElement > ( ) ;
331+ const scrollBodySizeInfo = ref < { scrollWidth : number ; clientWidth : number } > ( {
332+ scrollWidth : 0 ,
333+ clientWidth : 0 ,
334+ } ) ;
330335 const scrollSummaryRef = ref < HTMLDivElement > ( ) ;
331336 const [ pingedLeft , setPingedLeft ] = useState ( false ) ;
332337 const [ pingedRight , setPingedRight ] = useState ( false ) ;
@@ -495,6 +500,18 @@ export default defineComponent<TableProps<DefaultRecordType>>({
495500 nextTick ( ( ) => {
496501 triggerOnScroll ( ) ;
497502 setScrollbarSize ( getTargetScrollBarSize ( scrollBodyRef . value ) . width ) ;
503+ scrollBodySizeInfo . value = {
504+ scrollWidth : scrollBodyRef . value ?. scrollWidth || 0 ,
505+ clientWidth : scrollBodyRef . value ?. clientWidth || 0 ,
506+ } ;
507+ } ) ;
508+ } ) ;
509+ onUpdated ( ( ) => {
510+ nextTick ( ( ) => {
511+ scrollBodySizeInfo . value = {
512+ scrollWidth : scrollBodyRef . value ?. scrollWidth || 0 ,
513+ clientWidth : scrollBodyRef . value ?. clientWidth || 0 ,
514+ } ;
498515 } ) ;
499516 } ) ;
500517
@@ -762,6 +779,7 @@ export default defineComponent<TableProps<DefaultRecordType>>({
762779 scrollBodyRef = { scrollBodyRef }
763780 onScroll = { onScroll }
764781 container = { container }
782+ scrollBodySizeInfo = { scrollBodySizeInfo . value }
765783 />
766784 ) }
767785 </ >
0 commit comments