From c8de9eb972ea87d8de5f3cd1a64ec0356c042a78 Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Fri, 17 Jun 2022 16:51:12 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20lvl2=20=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DcloudSearchPage/components/Result.vue | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/docs/.vuepress/theme/components/DcloudSearchPage/components/Result.vue b/docs/.vuepress/theme/components/DcloudSearchPage/components/Result.vue index 049dfa9a1..92b84877a 100644 --- a/docs/.vuepress/theme/components/DcloudSearchPage/components/Result.vue +++ b/docs/.vuepress/theme/components/DcloudSearchPage/components/Result.vue @@ -6,17 +6,13 @@ class="DocSearch-Hit-content-wrapper" v-if="item.hierarchy[item.type] && item.type === 'lvl1'" > - - + +
- - + +
@@ -24,7 +20,7 @@ class="DocSearch-Hit-title" v-html="snippetResultContent(`hierarchy.${item.type}`)" /> - +
@@ -63,6 +59,16 @@ isContent() { return this.item.type === 'content'; }, + contentHtml() { + return this.snippetResultContent('content'); + }, + hierarchyLvl1Html() { + return this.snippetResultContent('hierarchy.lvl1'); + }, + hierarchyLvl2Html() { + const lvl2 = this.snippetResultContent('hierarchy.lvl2'); + return this.isContent ? this.contentHtml === lvl2 ? '' : lvl2 : ''; + }, }, methods: { snippetResultContent(attribute) { -- GitLab