Skip to content

Commit 6ea61b0

Browse files
committed
update doc search
1 parent 4d1a491 commit 6ea61b0

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

docs/.vuepress/components/MarkdownContent.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ const nameMap = {
2626
product: '产品介绍',
2727
push: '即时推送',
2828
moderation: '内容审核',
29-
aigc: 'AI 集成'
29+
aigc: 'AI 集成',
30+
solution_common: '常见方案',
3031
}
3132
3233
const getCategoryFromPath = () => {

docs/.vuepress/layouts/InstanceSearchLayout.vue

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
'hierarchy.lvl2:20',
1616
'hierarchy.lvl3:20',
1717
'hierarchy.lvl4:20',
18-
'content:50'
18+
'content:150'
1919
]"
2020
/>
2121
<div class="search-box-container">
2222
<div class="search-container">
2323
<ais-search-box
2424
placeholder="热门搜索: 登录、消息扩展"
25-
autofocus
2625
show-loading-indicator
2726
/>
2827
<div class="search-category">
@@ -32,8 +31,8 @@
3231
<template
3332
v-slot="{ state: { query }, results: { nbHits }, status }"
3433
>
35-
<el-tabs v-model="activeCategoryType">
36-
<el-tab-pane name="product">
34+
<el-tabs class="search-tabs" :model-value="activeCategoryType">
35+
<el-tab-pane name="product" lazy="true">
3736
<template #label>
3837
<ais-clear-refinements
3938
:included-attributes="includeAttributes"
@@ -128,7 +127,7 @@
128127
}"
129128
@click="handleClick({ name: 'sdk', refine })"
130129
>
131-
SDK 集成文档
130+
SDK & REST 集成
132131
</div>
133132
</template>
134133
</ais-clear-refinements>
@@ -209,7 +208,7 @@
209208
}"
210209
@click="handleClick({ name: 'uikit', refine })"
211210
>
212-
UIKit 集成文档
211+
UIKit 集成
213212
</div>
214213
</template>
215214
</ais-clear-refinements>
@@ -326,8 +325,9 @@ const uikitCategoryMap = {
326325
327326
const productCategoryMap = {
328327
产品介绍: "产品介绍",
329-
即时推送: "即时推送",
330328
内容审核: "内容审核",
329+
solution_common: "常见方案",
330+
即时推送: "即时推送",
331331
"AI 集成": "AI 集成"
332332
};
333333
@@ -338,7 +338,7 @@ const categoryMap = {
338338
};
339339
340340
const productFilters =
341-
"category:'产品介绍' OR category:'即时推送' OR category:'内容审核' OR category:'AI 集成'";
341+
"category:'产品介绍' OR category:'即时推送' OR category:'内容审核' OR category:'AI 集成' OR category:'solution_common1'";
342342
343343
const sdkFilters =
344344
"category:'Andorid 集成文档' OR category:'iOS 集成文档' OR category:'Web 集成文档' OR category:'HarmonyOS 集成文档' OR category:'小程序集成文档' OR category:'Flutter 集成文档' OR category:'React Native 集成文档' OR category:'Windows 集成文档' OR category:'Unity 集成文档' OR category:'REST API'";
@@ -380,7 +380,7 @@ export default {
380380
),
381381
initialUiState: {
382382
["im-beta-easemob"]: {
383-
query: useRoute().query.query || "",
383+
query: useRoute().query.query || "IM",
384384
refinementList: {
385385
type: ["content"],
386386
category: categoryMap[this.$route.query.s]
@@ -426,6 +426,9 @@ export default {
426426
return;
427427
}
428428
refine();
429+
setTimeout(() => {
430+
this.activeCategoryType = name;
431+
}, 20);
429432
},
430433
getCategoryTypeByCategoryItem(categoryItem) {
431434
if (this.sdkCategories.includes(categoryItem)) {
@@ -527,6 +530,10 @@ body {
527530
font-size: 14px;
528531
}
529532
533+
.ais-ClearRefinements {
534+
height: 100%;
535+
}
536+
530537
/* 分类项的基础样式 */
531538
.refinement-list-item {
532539
padding: 10px 15px;
@@ -560,13 +567,16 @@ body {
560567
.ais-RatingMenu-link {
561568
color: var(--theme-color) !important;
562569
}
563-
564570
/* active状态的样式 */
565571
.refinement-list-item--selected {
566572
background-color: var(--theme-color); /* active状态的背景色 */
567573
color: #ffffff; /* active状态的文本颜色 */
568574
}
569575
576+
.search-tabs .el-tabs__item {
577+
pointer-events: none;
578+
}
579+
570580
.no-results {
571581
text-align: center;
572582
color: #4a5568;
@@ -585,6 +595,9 @@ body {
585595
.ais-tab-item {
586596
color: #303133;
587597
font-size: 15px !important;
598+
height: 100%;
599+
line-height: 40px;
600+
pointer-events: all;
588601
}
589602
590603
.ais-tab-item--active {

0 commit comments

Comments
 (0)