Skip to content

Commit

Permalink
(fixed): 筛选下拉菜单打包后异常
Browse files Browse the repository at this point in the history
  • Loading branch information
shanjingheng committed Jul 24, 2023
1 parent b5b12a1 commit d70289e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions docs/.vuepress/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
const pageData = usePageData()
const showPlatformSwitch = ref(false)
watch(pageData, ()=> {
const pagePath = pageData.value.path
showPlatformSwitch.value = pagePath.indexOf('/document') == 0
}, {immediate:true})
const showPrivateSwitch = ref(false)
watch(pageData, ()=> {
const pagePath = pageData.value.path
showPrivateSwitch.value = pagePath.indexOf('/private') == 0
showPrivateSwitch.value = pagePath.indexOf('/private/') == 0
showPlatformSwitch.value = pagePath.indexOf('/document/') == 0
}, {immediate:true})
Expand All @@ -23,10 +20,14 @@
<Sidebar>
<template #top>
<div v-show="showPlatformSwitch" class="platform-switch">
<PlatformSwitch />
<ClientOnly>
<PlatformSwitch />
</ClientOnly>
</div>
<div v-show="showPrivateSwitch" class="platform-switch">
<PrivateSwitch />
<ClientOnly>
<PrivateSwitch />
</ClientOnly>
</div>
</template>
</Sidebar>
Expand Down

0 comments on commit d70289e

Please sign in to comment.