File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,13 +61,21 @@ const handleScroll = (e) => {
6161 lastScrollY = currentScrollY <= 0 ? 0 : currentScrollY;
6262}
6363
64- onMounted (() => {
65- // Listen to scroll events during the capture phase to track child scrolling (like TutorialView)
66- window .addEventListener (' scroll' , handleScroll, true );
67- })
64+ const toggleScrollListener = (shouldListen ) => {
65+ if (shouldListen) {
66+ window .addEventListener (' scroll' , handleScroll, true );
67+ } else {
68+ window .removeEventListener (' scroll' , handleScroll, true );
69+ isHidden .value = false ; // Reset state when leaving
70+ }
71+ }
72+
73+ watch (() => route .path , () => {
74+ toggleScrollListener (!! route .meta .hideNavOnScroll );
75+ }, { immediate: true }) // immediate: true runs this once on mount
6876
6977onUnmounted (() => {
70- window . removeEventListener ( ' scroll ' , handleScroll, true );
78+ toggleScrollListener ( false );
7179 document .body .classList .remove (' nav-hidden' );
7280})
7381 </script >
Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ const routes = [
77 } ,
88 {
99 path : '/tutorial' ,
10- component : ( ) => import ( '../pages/TutorialView.vue' )
10+ component : ( ) => import ( '../pages/TutorialView.vue' ) ,
11+ meta : { hideNavOnScroll : true }
1112 } ,
1213 {
1314 path : '/launch' ,
You can’t perform that action at this time.
0 commit comments