|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { provide } from 'vue'
|
|
|
|
|
import { provide, watch } from 'vue'
|
|
|
|
|
import { useRoute } from 'vitepress'
|
|
|
|
|
import { useSidebar, useCloseSidebarOnEscape } from './composables/sidebar'
|
|
|
|
|
import VPSkipLink from './components/VPSkipLink.vue'
|
|
|
|
|
import VPBackdrop from './components/VPBackdrop.vue'
|
|
|
|
@ -15,6 +16,12 @@ const {
|
|
|
|
|
close: closeSidebar
|
|
|
|
|
} = useSidebar()
|
|
|
|
|
|
|
|
|
|
watch(useRoute(), () => {
|
|
|
|
|
if (isSidebarOpen) {
|
|
|
|
|
closeSidebar()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
useCloseSidebarOnEscape(isSidebarOpen, closeSidebar)
|
|
|
|
|
|
|
|
|
|
provide('close-sidebar', closeSidebar)
|
|
|
|
|