Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion packages/vue/src/grid/src/body/src/body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,6 @@ export default defineComponent({
const { bodyWrapperHeight, bodyWrapperMinHeight, bodyWrapperMaxHeight } = $table
const $slots = $grid.slots
const _vm = this

return (
<div
ref="body"
Expand Down
6 changes: 6 additions & 0 deletions packages/vue/src/grid/src/table/src/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,10 @@ export default defineComponent({
const bodyWrapperMinHeight = hooks.ref()
// 外部设置的表体容器最大高度
const bodyWrapperMaxHeight = hooks.ref()
// 表格滚动宽度
const containerScrollWidth = hooks.ref(0)
// 表格滚动高度
const containerScrollHeight = hooks.ref(0)
Comment on lines +662 to +665
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Populate the new scroll refs or the pager-height bug will persist.

containerScrollWidth / containerScrollHeight are introduced here but never assigned anywhere else in the module, so they remain stuck at 0. Without wiring them into the code that measures the body wrapper (e.g., the resize handlers / GridBody scroll listeners), nothing downstream can react to the real scroll dimensions, meaning the table height issue after changing page size is still unfixed. Please make sure these refs are updated when the container mounts and whenever its scroll size changes.

🤖 Prompt for AI Agents
packages/vue/src/grid/src/table/src/table.ts around lines 662 to 665: the newly
added refs containerScrollWidth and containerScrollHeight are never updated,
leaving them at 0 and causing the pager-height bug; update these refs when the
container mounts and whenever its scroll size changes by wiring them into the
container mount logic and existing resize/scroll handlers (or add listeners on
GridBody): read element.scrollWidth and element.scrollHeight (using nextTick if
needed) and assign to the refs, ensure handlers run on mount and on
resize/scroll events, and unregister listeners on unmount.

// 表体表格元素宽度
const bodyTableWidth = hooks.ref()
// 滚动加载滚动高度
Expand Down Expand Up @@ -826,6 +830,8 @@ export default defineComponent({
bodyWrapperHeight,
bodyWrapperMinHeight,
bodyWrapperMaxHeight,
containerScrollWidth,
containerScrollHeight,
bodyTableWidth,
scrollLoadScrollHeight,
columnStore,
Expand Down
Loading