11<script setup lang="ts">
2- import { ref , onMounted , onUnmounted } from ' vue' ;
2+ import { ref , onMounted , onUnmounted } from " vue" ;
33
4- const nav = [{ text: ' Docs' , link: ' /vite/guide' }];
4+ const nav = [{ text: " Docs" , link: " /vite/guide" }];
55
66// Mobile menu state
77const mobileMenuOpen = ref (false );
@@ -10,21 +10,21 @@ const expandedMobileItem = ref<string | null>(null);
1010// Body scroll lock for mobile menu
1111const lockBodyScroll = () => {
1212 const scrollbarWidth = window .innerWidth - document .documentElement .clientWidth ;
13- document .body .style .overflow = ' hidden' ;
14- document .body .style .position = ' fixed' ;
15- document .body .style .width = ' 100%' ;
16- document .body .style .top = ' 0 ' ;
13+ document .body .style .overflow = " hidden" ;
14+ document .body .style .position = " fixed" ;
15+ document .body .style .width = " 100%" ;
16+ document .body .style .top = " 0 " ;
1717 if (scrollbarWidth > 0 ) {
1818 document .body .style .paddingRight = ` ${scrollbarWidth }px ` ;
1919 }
2020};
2121
2222const unlockBodyScroll = () => {
23- document .body .style .overflow = ' ' ;
24- document .body .style .position = ' ' ;
25- document .body .style .width = ' ' ;
26- document .body .style .top = ' ' ;
27- document .body .style .paddingRight = ' ' ;
23+ document .body .style .overflow = " " ;
24+ document .body .style .position = " " ;
25+ document .body .style .width = " " ;
26+ document .body .style .top = " " ;
27+ document .body .style .paddingRight = " " ;
2828};
2929
3030// Close mobile menu
@@ -36,7 +36,7 @@ const closeMobileMenu = () => {
3636
3737// Handle keyboard navigation
3838const handleKeydown = (e : KeyboardEvent ) => {
39- if (e .key === ' Escape' ) {
39+ if (e .key === " Escape" ) {
4040 if (mobileMenuOpen .value ) {
4141 closeMobileMenu ();
4242 }
@@ -56,11 +56,11 @@ const toggleMobileMenu = () => {
5656};
5757
5858onMounted (() => {
59- document .addEventListener (' keydown' , handleKeydown );
59+ document .addEventListener (" keydown" , handleKeydown );
6060});
6161
6262onUnmounted (() => {
63- document .removeEventListener (' keydown' , handleKeydown );
63+ document .removeEventListener (" keydown" , handleKeydown );
6464 unlockBodyScroll ();
6565});
6666 </script >
0 commit comments