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