File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -412,7 +412,22 @@ const documentOnmouseup = function ({
412412 Object . assign ( $table , { _isResize : false , _lastResizeTime : Date . now ( ) } )
413413
414414 $table . analyColumnWidth ( )
415- $table . recalculate ( )
415+ $table . recalculate ( ) . then ( ( ) => {
416+ // 拖拽后,需要同步表头的scrollLeft
417+ const { tableBody, tableFooter, tableHeader } = $table . $refs || { }
418+ const headerElm = tableHeader ?. $el
419+ const bodyElm = tableBody ?. $el
420+ const footerElm = tableFooter ?. $el
421+ if ( ! headerElm ) {
422+ return
423+ }
424+ if ( bodyElm ) {
425+ bodyElm . scrollLeft = headerElm . scrollLeft
426+ }
427+ if ( footerElm ) {
428+ footerElm . scrollLeft = headerElm . scrollLeft
429+ }
430+ } )
416431 updateResizableToolbar ( $table )
417432 emitEvent ( $table , 'resizable-change' , [ params ] )
418433}
You can’t perform that action at this time.
0 commit comments