From d5500c8f4904396bc77b4cd9500ffa65cc59540f Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Wed, 11 Dec 2024 12:29:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=97=E8=A1=A8=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 2 +- src/components/VirtualList.vue | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index bd6e0dd..07a1e74 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,7 +5,7 @@ import VirtualList from './components/VirtualList.vue' const listConfig = { itemHeight: 50, itemPadding: 16, - bufferCount: 2, + bufferCount: 10, scrollDebounceTime: 16, } diff --git a/src/components/VirtualList.vue b/src/components/VirtualList.vue index a4763a9..c2414a1 100644 --- a/src/components/VirtualList.vue +++ b/src/components/VirtualList.vue @@ -290,14 +290,14 @@ onBeforeUnmount(() => { padding: 8px 16px; display: flex; align-items: center; - border-bottom: 1px solid #e8e8e8; - transition: background-color 0.2s; + transition: background-color 0.8s ease; cursor: pointer; background-color: white; } +/* 简单的选中高亮效果 */ .list-item.selected { - background-color: #e6f7ff; + background-color: rgba(64, 169, 255, 0.15); } /* 默认列表项样式 */