mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-06-08 22:54:09 +08:00
fix: 偏移量未重置导致列表不加载 懒加载存在data-gap
This commit is contained in:
parent
0fe391adc0
commit
c7e571d6e8
@ -6,7 +6,7 @@
|
||||
:fullData="fullData"
|
||||
@onOverlayClick="toggleFullData('')"
|
||||
></ClipFullData>
|
||||
<ClipSwitch ref="ClipSwitchRef" @onNavClick="updateShowList">
|
||||
<ClipSwitch ref="ClipSwitchRef" @onNavClick="handleNavClick">
|
||||
<template #SidePanel>
|
||||
<ClipSearch v-model="filterText"></ClipSearch>
|
||||
</template>
|
||||
@ -59,6 +59,11 @@ const updateShowList = (type) => {
|
||||
window.toTop()
|
||||
}
|
||||
|
||||
const handleNavClick = (type) => {
|
||||
updateShowList(type)
|
||||
offset.value = 0 // 重置懒加载偏移量
|
||||
}
|
||||
|
||||
const fullData = ref({ type: 'text', data: '' })
|
||||
const fullDataShow = ref(false)
|
||||
const toggleFullData = (item) => {
|
||||
@ -115,7 +120,7 @@ onMounted(() => {
|
||||
document.addEventListener('scroll', (e) => {
|
||||
const { scrollTop, clientHeight, scrollHeight } = e.target.scrollingElement
|
||||
if (scrollTop + clientHeight + 20 >= scrollHeight) {
|
||||
offset.value += GAP + 1
|
||||
offset.value += GAP
|
||||
let addition = []
|
||||
if (activeTab.value !== 'all') {
|
||||
addition = list.value.filter((item) => item.type === activeTab.value)
|
||||
|
Loading…
x
Reference in New Issue
Block a user