From f0ec23bccef882701aa3d3fd83a633b3224e0e4a Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Wed, 11 Dec 2024 16:44:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=98=E9=87=8F=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 3 +-- src/components/ProjectList.vue | 9 +++++---- src/components/VirtualList.vue | 12 ++++++------ src/types/index.ts | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/App.vue b/src/App.vue index a3a8f67..cbd3449 100644 --- a/src/App.vue +++ b/src/App.vue @@ -8,8 +8,7 @@ const samplePic = const listData: ListItem[] = Array.from({ length: 1000 }, (_, i) => ({ id: i, name: `project-${i + 1}`, - path: `/Users/lanyuanxiaoyao/Project/IdeaProjects/project-${i + 1}`, - // 随机选择一个图标 + description: `这是项目 ${i + 1} 的详细描述信息`, icon: samplePic, tags: [ ...(i % 2 === 0 ? [{ id: 1, name: 'Vue', color: '#42b883' }] : []), diff --git a/src/components/ProjectList.vue b/src/components/ProjectList.vue index 9dc5d03..c6c92d1 100644 --- a/src/components/ProjectList.vue +++ b/src/components/ProjectList.vue @@ -281,7 +281,7 @@ const onAfterLeave = (el: Element): void => {
{{ selectedItem.name }}
-
{{ selectedItem.path }}
+
{{ selectedItem.description }}
{ gap: 8px; } -/* 选中项路径 */ -.selected-item-path { +/* 选中项描述 */ +.selected-item-description { font-size: 12px; color: rgba(0, 0, 0, 0.6); - word-break: break-all; + word-break: break-word; + overflow-wrap: break-word; line-height: 1.5; } diff --git a/src/components/VirtualList.vue b/src/components/VirtualList.vue index a213793..3e60db0 100644 --- a/src/components/VirtualList.vue +++ b/src/components/VirtualList.vue @@ -193,7 +193,7 @@ const lastReachBoundaryTime = ref<{ top: number; bottom: number }>({ }) /** - * 处理��盘事件 + * 处理键盘事件 * 实现键盘导航、边界循环和项目选择功能 * @param e 键盘事件对象 */ @@ -415,8 +415,8 @@ onBeforeUnmount(() => {
-
-
{{ item.path }}
+
+
{{ item.description }}
@@ -526,13 +526,13 @@ onBeforeUnmount(() => { } /* 信息行布局 */ -.item-info { +.item-description { display: flex; gap: 4px; } -/* 路径文本样式 */ -.item-path { +/* 描述文本样式 */ +.item-description-text { font-size: 12px; color: rgba(0, 0, 0, 0.6); white-space: nowrap; diff --git a/src/types/index.ts b/src/types/index.ts index 3882bf0..364253f 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -18,8 +18,8 @@ export interface ListItem { id: number /** 项目名称 */ name: string - /** 项目路径 */ - path: string + /** 项目描述 */ + description: string /** 项目图标 URL */ icon?: string /** 项目标签列表 */