default.vue 577 B

1234567891011121314151617181920212223242526
  1. <template>
  2. <div ref="globalWindow" class="flex flex-col w-screen h-screen bg-[#030100] text-white overflow-y-hidden">
  3. <SideBar />
  4. <Header />
  5. <main class="flex-auto">
  6. <slot />
  7. </main>
  8. <NavBar />
  9. </div>
  10. </template>
  11. <script setup lang="ts">
  12. import { useSwipe } from '@vueuse/core'
  13. import { useSideBar } from '~/store/useSideBar';
  14. const store = useSideBar()
  15. const globalWindow = ref(null)
  16. const {direction, lengthX} = useSwipe(globalWindow, {
  17. onSwipeEnd() {
  18. if (direction.value === 'right')
  19. store.show()
  20. }
  21. })</script>