mirror of https://github.com/vuejs/vitepress
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
926 B
32 lines
926 B
<script setup lang="ts">
|
|
import { provide } from 'vue'
|
|
import { useSidebar, useCloseSidebarOnEscape } from './composables/sidebar'
|
|
import VPSkipLink from './components/VPSkipLink.vue'
|
|
import VPBackdrop from './components/VPBackdrop.vue'
|
|
import VPNav from './components/VPNav.vue'
|
|
import VPLocalNav from './components/VPLocalNav.vue'
|
|
import VPSidebar from './components/VPSidebar.vue'
|
|
import VPContent from './components/VPContent.vue'
|
|
|
|
const {
|
|
isOpen: isSidebarOpen,
|
|
open: openSidebar,
|
|
close: closeSidebar
|
|
} = useSidebar()
|
|
|
|
useCloseSidebarOnEscape(isSidebarOpen, closeSidebar)
|
|
|
|
provide('close-sidebar', closeSidebar)
|
|
</script>
|
|
|
|
<template>
|
|
<div class="Layout">
|
|
<VPSkipLink />
|
|
<VPBackdrop class="backdrop" :show="isSidebarOpen" @click="closeSidebar" />
|
|
<VPNav />
|
|
<VPLocalNav :open="isSidebarOpen" @open-menu="openSidebar" />
|
|
<VPSidebar :open="isSidebarOpen" />
|
|
<VPContent />
|
|
</div>
|
|
</template>
|