mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-06-05 07:41:58 +08:00
🐛 Fix(custom): fix gallery scroll bug
This commit is contained in:
@@ -94,6 +94,16 @@ export function useVirtualGrid(options: UseVirtualGridOptions) {
|
||||
}
|
||||
})
|
||||
|
||||
watch(
|
||||
() => items.value.length,
|
||||
() => {
|
||||
const { totalHeight } = gridCalculations.value
|
||||
if (scrollTop.value > totalHeight - containerHeight.value) {
|
||||
scrollTop.value = Math.max(0, totalHeight - containerHeight.value)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
return {
|
||||
gridCalculations,
|
||||
visibleIndexes,
|
||||
|
||||
Reference in New Issue
Block a user