Skip to content

Commit

Permalink
fix:修复plus会显示头部搜索和描述问题 (#3002)
Browse files Browse the repository at this point in the history
  • Loading branch information
discreted66 authored Mar 4, 2025
1 parent 6587d10 commit 2c30b32
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
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

0 comments on commit 2c30b32

Please sign in to comment.