Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion packages/vue/src/grid/src/header/src/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,31 @@ const documentOnmouseup = function ({
Object.assign($table, { _isResize: false, _lastResizeTime: Date.now() })

$table.analyColumnWidth()
$table.recalculate()
$table.recalculate().then(() => {
// 拖拽后,需要同步表头的scrollLeft
const { tableBody, tableFooter, tableHeader } = $table.$refs || {}
const headerElm = tableHeader?.$el
const bodyElm = tableBody?.$el
const footerElm = tableFooter?.$el
if (!headerElm) {
return
}
const elemStore = $table.elemStore
if (bodyElm) {
bodyElm.scrollLeft = headerElm.scrollLeft

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that bodyElm and footerElm are not null before accessing scrollLeft. This prevents potential runtime errors if these elements are not present.

}
if (footerElm) {
footerElm.scrollLeft = headerElm.scrollLeft
}

if (!elemStore['main-header-repair']) {
return
}
elemStore['main-body-xSpace'].style.width = elemStore['main-header-repair'].style.width
if (elemStore['main-footer-xSpace']) {
elemStore['main-footer-xSpace'].style.width = elemStore['main-header-repair'].style.width
}
})
updateResizableToolbar($table)
emitEvent($table, 'resizable-change', [params])
}
Expand Down
Loading