File tree 1 file changed +25
-1
lines changed
1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -412,7 +412,31 @@ const documentOnmouseup = function ({
412
412
Object . assign ( $table , { _isResize : false , _lastResizeTime : Date . now ( ) } )
413
413
414
414
$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
+ } )
416
440
updateResizableToolbar ( $table )
417
441
emitEvent ( $table , 'resizable-change' , [ params ] )
418
442
}
You can’t perform that action at this time.
0 commit comments