雨溪 3 weeks ago committed by GitHub
commit 1c092eaf83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -6,6 +6,7 @@ import { nextTick, ref, watch } from 'vue'
import { useData } from '../composables/data'
import { resolveTitle } from '../composables/outline'
import VPDocOutlineItem from './VPDocOutlineItem.vue'
import { useSidebar } from '../composables/sidebar'
const props = defineProps<{
headers: DefaultTheme.OutlineItem[]
@ -17,6 +18,7 @@ const open = ref(false)
const vh = ref(0)
const main = ref<HTMLDivElement>()
const items = ref<HTMLDivElement>()
const { hasSidebar } = useSidebar()
function closeOnClickOutside(e: Event) {
if (!main.value?.contains(e.target as Node)) {
@ -68,6 +70,9 @@ function scrollToTop() {
class="VPLocalNavOutlineDropdown"
:style="{ '--vp-vh': vh + 'px' }"
ref="main"
:class="{
'has-sidebar': hasSidebar,
}"
>
<button @click="toggle" :class="{ open }" v-if="headers.length > 0">
<span class="menu-text">{{ resolveTitle(theme) }}</span>
@ -156,6 +161,9 @@ function scrollToTop() {
left: calc(var(--vp-sidebar-width) + 32px);
width: 320px;
}
.VPLocalNavOutlineDropdown:not(.has-sidebar) .items {
left:32px;
}
}
.header {

Loading…
Cancel
Save