From 6f4500f31ae18efc8988b5006762ac817c5973a0 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Fri, 11 Mar 2022 15:10:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8E=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/components/base/VirtualizedList.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/base/VirtualizedList.vue b/src/renderer/components/base/VirtualizedList.vue index 99b132d8..a53d4000 100644 --- a/src/renderer/components/base/VirtualizedList.vue +++ b/src/renderer/components/base/VirtualizedList.vue @@ -141,8 +141,8 @@ export default { const scrollContainerHeight = dom_scrollContainer.value.clientHeight const currentEndIndex = currentStartIndex + Math.ceil(scrollContainerHeight / itemHeight) const continuous = currentStartIndex <= endIndex && currentEndIndex >= startIndex - const currentStartRenderIndex = Math.max(Math.floor(currentScrollTop / itemHeight) - props.outsideNum, 0) - const currentEndRenderIndex = currentStartIndex + Math.ceil(scrollContainerHeight / itemHeight) + props.outsideNum + const currentStartRenderIndex = Math.max(currentStartIndex - props.outsideNum, 0) + const currentEndRenderIndex = currentEndIndex + props.outsideNum + 1 // console.log(continuous) // debugger if (continuous) { @@ -161,7 +161,7 @@ export default { // // console.log('scroll up') // views.value = createList(currentStartRenderIndex, currentEndRenderIndex) // } else return - if (currentScrollTop == scrollTop) return + if (currentScrollTop == scrollTop && endIndex >= currentEndIndex) return views.value = createList(currentStartRenderIndex, currentEndRenderIndex) } else { views.value = createList(currentStartRenderIndex, currentEndRenderIndex)