From a6efc547668fa613457373b11ccb02dd9241ec26 Mon Sep 17 00:00:00 2001 From: Theo <971366405@qq.com> Date: Tue, 13 Aug 2024 22:48:29 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20:recycle:=20=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=97=B6=EF=BC=8C=E5=AF=B9=E4=BA=8E=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E7=9A=84=E7=89=B9=E6=AE=8A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 菜单搜索时,对于首页的特殊处理 --- src/components/MenuSearch/index.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/MenuSearch/index.vue b/src/components/MenuSearch/index.vue index 142b8cd7..26a8ba4f 100644 --- a/src/components/MenuSearch/index.vue +++ b/src/components/MenuSearch/index.vue @@ -103,9 +103,11 @@ function initSearchData(routes: RouteRecordRaw[], parentPath: string = "") { if (item.children) { initSearchData(item.children, path); } else if (item.meta && item.meta.title && item.path) { + let title = item.meta.title == "dashboard" ? "首页" : item.meta.title; + let toLowerCaseTitle = title.toLowerCase(); searchData.value.push({ - title: item.meta.title, - toLowerCaseTitle: item.meta.title.toLowerCase(), + title: title, + toLowerCaseTitle: toLowerCaseTitle, path: path, name: item.name, icon: item.meta.icon,