7
7
NFlex ,
8
8
NIcon ,
9
9
} from ' naive-ui' ;
10
- import { ref , Transition , watch } from ' vue' ;
10
+ import { onBeforeUnmount , onMounted , ref , Transition , watch } from ' vue' ;
11
11
import { RouterView , useRouter } from ' vue-router' ;
12
12
13
13
import GridBackground from ' ~/components/common/background/GridBackground.vue' ;
@@ -17,6 +17,7 @@ import NavbarComponent from '~/components/common/navbar/NavbarComponent.vue';
17
17
import IconChevronLeft from ' ~/components/icons/IconChevronLeft.vue' ;
18
18
import IconClose from ' ~/components/icons/IconClose.vue' ;
19
19
import CheckinComponent from ' ~/components/views/checkin/CheckinComponent.vue' ;
20
+ import { NavbarService } from ' ~/services/navbar.service' ;
20
21
import { useAppStateStoreRefs } from ' ~/stores/app-state.store' ;
21
22
import { useAuthSettingsStoreRefs } from ' ~/stores/settings/auth.store' ;
22
23
@@ -27,9 +28,9 @@ const { footerOpen, panelOpen, panelDirty } = useAppStateStoreRefs();
27
28
28
29
const base = ref ();
29
30
30
- const appRef = ref ();
31
- const mainRef = ref ();
32
- const footerRef = ref ();
31
+ const appRef = ref < HTMLDivElement > ();
32
+ const mainRef = ref < HTMLDivElement > ();
33
+ const footerRef = ref < HTMLDivElement > ();
33
34
34
35
watch (
35
36
currentRoute ,
@@ -59,6 +60,13 @@ const onBack = () => {
59
60
if (window .history .state .back ) return back ();
60
61
return onClose ();
61
62
};
63
+
64
+ onMounted (() => {
65
+ mainRef .value ?.addEventListener (' touchstart' , NavbarService .hideDrawer );
66
+ });
67
+ onBeforeUnmount (() => {
68
+ mainRef .value ?.removeEventListener (' touchstart' , NavbarService .hideDrawer );
69
+ });
62
70
</script >
63
71
64
72
<template >
0 commit comments