File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -412,7 +412,31 @@ 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+ const elemStore = $table . elemStore
425+ if ( bodyElm ) {
426+ bodyElm . scrollLeft = headerElm . scrollLeft
427+ }
428+ if ( footerElm ) {
429+ footerElm . scrollLeft = headerElm . scrollLeft
430+ }
431+
432+ if ( ! elemStore [ 'main-header-repair' ] ) {
433+ return
434+ }
435+ elemStore [ 'main-body-xSpace' ] . style . width = elemStore [ 'main-header-repair' ] . style . width
436+ if ( elemStore [ 'main-footer-xSpace' ] ) {
437+ elemStore [ 'main-footer-xSpace' ] . style . width = elemStore [ 'main-header-repair' ] . style . width
438+ }
439+ } )
416440 updateResizableToolbar ( $table )
417441 emitEvent ( $table , 'resizable-change' , [ params ] )
418442}
You can’t perform that action at this time.
0 commit comments