Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs):Fixed an issue where plus will display header search and description #3002

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions examples/sites/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ hljs.registerLanguage('javascript', javascript)
hljs.registerLanguage('css', css)
hljs.registerLanguage('html', html)

docsearch({
appId: 'AGPA5UXHMH',
apiKey: '5fa09fc20270efa61d68e2c2eb0f56df',
indexName: 'opentiny',
container: '.search-box',
debug: false
})
if (!location.href.includes('tiny-vue-plus')) {
docsearch({
appId: 'AGPA5UXHMH',
apiKey: '5fa09fc20270efa61d68e2c2eb0f56df',
indexName: 'opentiny',
container: '.search-box',
debug: false
})
}

if (envTarget !== 'open') {
// 支持本地开发和内网使用全局搜索
Expand Down
8 changes: 5 additions & 3 deletions examples/sites/src/views/overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<span class="ti-f18">({{ getTotalComponentsNum() }})</span>
</h1>

<h1 class="overview-desc ti-f14 ti-my20 ti-lh21">
<h1 v-if="!isPlus" class="overview-desc ti-f14 ti-my20 ti-lh21">
{{ i18nByKey('overviewDesc') }}
</h1>
<!-- 搜索 -->
Expand Down Expand Up @@ -64,7 +64,7 @@
</template>

<script lang="js">
import { defineComponent, reactive, toRefs, onMounted } from 'vue'
import { defineComponent, reactive, toRefs, computed, onMounted } from 'vue'
import { useRoute } from 'vue-router'
import { cmpMenus } from '@menu/menus.js'
import { TinyInput } from '@opentiny/vue'
Expand All @@ -85,6 +85,8 @@ export default defineComponent({
value: '',
palceMenus: new Array(14)
})

const isPlus = computed(() => location.href.includes('tiny-vue-plus'))
function debounce(fn, delay) {
let timeout = 0
return (value) => {
Expand Down Expand Up @@ -162,7 +164,7 @@ export default defineComponent({
const common = new window.TDCommon(['#footer'], {})
common.renderFooter()
})
return { ...toRefs(state), ...fn, TinyInput, noDataSvg, searchSvg, isZhCn, getWord, i18nByKey, pubUrl }
return { ...toRefs(state), ...fn, TinyInput, noDataSvg, searchSvg, isZhCn, getWord, i18nByKey, pubUrl, isPlus }
}
})
</script>
Expand Down
Loading