Skip to content

Commit cd774f0

Browse files
authored
fix:修复plus官网描述和搜索 (#3061)
1 parent 7133db9 commit cd774f0

File tree

5 files changed

+97
-13
lines changed

5 files changed

+97
-13
lines changed

examples/sites/src/i18n/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"backTop": "Back To Top",
3333
"overview": "Components Overview",
3434
"overviewDesc": "TinyVue provides a wealth of basic UI components for web applications, and we will continue to explore the best UI practices for enterprise-level applications. Welcome to try TinyVue.",
35+
"overviewDescPlus": "TinyVuePlus is a component library for Cloud business scenarios based on TinyVue, following the new design specifications of Cloud CloudDesign and utilizing Vite+Vue3+TypeScript technology stack.",
3536
"searchComponents": "search components",
3637
"apiType": "Components demos code style",
3738
"apiStyleOptions": "Options",
@@ -41,4 +42,4 @@
4142
"demoModeMultiple": "Multiple",
4243
"contributor": "Contributors",
4344
"noData": "No Data"
44-
}
45+
}

examples/sites/src/i18n/zh.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"backTop": "返回顶部",
3333
"overview": "组件总览",
3434
"overviewDesc": "TinyVue 为 Web 应用提供了丰富的基础 UI 组件,我们还将持续探索企业级应用的最佳 UI 实践,欢迎尝试使用 TinyVue。",
35+
"overviewDescPlus": "TinyVuePlus 是一款基于 TinyVue 的面向云业务场景的组件库,遵循 CloudDesign 新设计规范,基于 Vite + Vue3 + TypeScript 技术栈。",
3536
"searchComponents": "搜索组件",
3637
"apiType": "组件示例代码风格",
3738
"apiStyleOptions": "选项式",
@@ -41,4 +42,4 @@
4142
"demoModeMultiple": "多示例",
4243
"contributor": "贡献者",
4344
"noData": "暂无数据"
44-
}
45+
}

examples/sites/src/main.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ hljs.registerLanguage('javascript', javascript)
4141
hljs.registerLanguage('css', css)
4242
hljs.registerLanguage('html', html)
4343

44-
docsearch({
45-
appId: 'AGPA5UXHMH',
46-
apiKey: '5fa09fc20270efa61d68e2c2eb0f56df',
47-
indexName: 'opentiny',
48-
container: '.search-box',
49-
debug: false
50-
})
44+
if (!location.href.includes('tiny-vue-plus')) {
45+
docsearch({
46+
appId: 'AGPA5UXHMH',
47+
apiKey: '5fa09fc20270efa61d68e2c2eb0f56df',
48+
indexName: 'opentiny',
49+
container: '.search-box',
50+
debug: false
51+
})
52+
}
5153

5254
if (envTarget !== 'open') {
5355
// 支持本地开发和内网使用全局搜索

examples/sites/src/views/components/components.vue

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,84 @@
2020
<div class="ti-rel cmp-container">
2121
<div class="flex-horizontal docs-content-main">
2222
<div class="docs-tabs-wrap">
23-
<tiny-tabs v-model="activeTab" ref="demoTabs" class="docs-content-tabs" @click="onTabsClick">
23+
<div v-if="['interfaces', 'types', 'classes'].includes(cmpId)" id="TS" class="all-api-container">
24+
<div class="ti-f-c ti-f-wrap api-list">
25+
<div class="mt20" v-for="oneGroup in currJson.apis" :key="oneGroup.name">
26+
<div class="ti-f-r ti-f-pos-start ti-fw-bold">
27+
<div :id="`cmp-${oneGroup.name}`" class="ti-f18">
28+
{{ oneGroup.name }}
29+
</div>
30+
<div class="ti-ml12 ti-b-a-primary ti-c-primary ti-px8 ti-py4">
31+
{{ oneGroup.type }}
32+
</div>
33+
</div>
34+
<div v-for="(oneApiArr, key) in oneGroup" :key="key">
35+
<template v-if="key !== 'name' && key !== 'type' && oneApiArr.length > 0">
36+
<div class="ti-f18 ti-py28" :id="`${oneGroup.name}--${key}`">
37+
{{ key }}
38+
</div>
39+
<div class="api-table-box">
40+
<tiny-grid class="api-table" :data="tableData[oneGroup.name][key]" :expand-config="apiExpandConf">
41+
<tiny-grid-column
42+
v-if="tableData[oneGroup.name][key][0]?.type"
43+
class-name="api-table-expand-col"
44+
type="expand"
45+
width="32"
46+
>
47+
<template #default="{ row }">
48+
<async-highlight v-if="row.code" :code="row.code.trim()" types="ts"></async-highlight>
49+
</template>
50+
</tiny-grid-column>
51+
<tiny-grid-column field="name" :title="i18nByKey('name')" :width="columnWidth[key][0]">
52+
<template #default="{ row }">
53+
<span class="api-table-name">
54+
<a v-if="row.demoId" @click="jumpToDemo(row.demoId)">{{ row.name }}</a>
55+
<span v-else>{{ row.name }}</span>
56+
</span>
57+
<version-tip
58+
v-if="row.meta || row.versionTipOption"
59+
:meta="row.meta"
60+
v-bind="row.versionTipOption"
61+
render-type="tag"
62+
tip-subject="api"
63+
>
64+
</version-tip>
65+
</template>
66+
</tiny-grid-column>
67+
<tiny-grid-column
68+
v-if="tableData[oneGroup.name][key][0]?.type"
69+
field="type"
70+
:title="i18nByKey('propType')"
71+
:width="columnWidth[key][1]"
72+
>
73+
<template #default="{ row }">
74+
<a
75+
v-if="row.typeAnchorName"
76+
:href="`${row.typeAnchorName.indexOf('#') === -1 ? '#' : ''}${row.typeAnchorName}`"
77+
v-html="row.type"
78+
></a>
79+
<span v-else v-html="row.type"></span>
80+
</template>
81+
</tiny-grid-column>
82+
<tiny-grid-column
83+
v-if="key === 'props'"
84+
field="defaultValue"
85+
:title="i18nByKey('defValue')"
86+
:width="columnWidth[key][2]"
87+
></tiny-grid-column>
88+
<tiny-grid-column field="desc" :title="i18nByKey('desc')">
89+
<template #default="data">
90+
<span v-html="data.row.desc"></span>
91+
</template>
92+
</tiny-grid-column>
93+
</tiny-grid>
94+
</div>
95+
</template>
96+
</div>
97+
</div>
98+
</div>
99+
</div>
100+
<tiny-tabs v-else v-model="activeTab" ref="demoTabs" class="docs-content-tabs" @click="onTabsClick">
24101
<tiny-tab-item :title="i18nByKey('demos')" name="demos">
25102
<!-- demos列表 -->
26103
<template v-if="currJson?.demos?.length">

examples/sites/src/views/overview.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</h1>
88

99
<h1 class="ti-f14 ti-my20 ti-lh21">
10-
{{ i18nByKey('overviewDesc') }}
10+
{{ i18nByKey(isPlus ? 'overviewDescPlus' : 'overviewDesc') }}
1111
</h1>
1212
<!-- 搜索 -->
1313
<tiny-input
@@ -64,7 +64,7 @@
6464
</template>
6565

6666
<script lang="js">
67-
import { defineComponent, reactive, toRefs, onMounted } from 'vue'
67+
import { defineComponent, reactive, toRefs, computed, onMounted } from 'vue'
6868
import { useRoute } from 'vue-router'
6969
import { cmpMenus } from '@menu/menus.js'
7070
import TinyInput from '@opentiny/vue-input'
@@ -85,6 +85,7 @@ export default defineComponent({
8585
value: '',
8686
palceMenus: new Array(14)
8787
})
88+
const isPlus = computed(() => location.href.includes('tiny-vue-plus'))
8889
function debounce(fn, delay) {
8990
let timeout = 0
9091
return (value) => {
@@ -162,7 +163,7 @@ export default defineComponent({
162163
const common = new window.TDCommon(['#footer'], {})
163164
common.renderFooter()
164165
})
165-
return { ...toRefs(state), ...fn, TinyInput, noDataSvg, searchSvg, isZhCn, getWord, i18nByKey, pubUrl }
166+
return { ...toRefs(state), ...fn, TinyInput, noDataSvg, searchSvg, isZhCn, getWord, i18nByKey, isPlus, pubUrl }
166167
}
167168
})
168169
</script>
@@ -198,6 +199,7 @@ export default defineComponent({
198199
font-size: 14px;
199200
color: rgb(51, 54, 57);
200201
line-height: 1.6;
202+
201203
&:hover {
202204
box-shadow: 1px 1px 6px 6px rgba(31, 52, 121, 0.08);
203205
}
@@ -227,6 +229,7 @@ export default defineComponent({
227229
.overview-card {
228230
gap: 2%;
229231
}
232+
230233
.overview-card-container {
231234
width: 49%;
232235
}

0 commit comments

Comments
 (0)