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); } /* 默认列表项样式 */