diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index 524554b..243e3a5 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -57,6 +57,7 @@ const clickMain = (val: string) => { router.push(val) currentRoute.value = val tab.value=val + window.scrollTo({ top: 0, left: 0, behavior: 'smooth' }); }; const clickTab= (val2: string) => { @@ -68,21 +69,28 @@ const clickTab= (val2: string) => { const goHome = () => { router.push('/') currentRoute.value = 'home' + window.scrollTo({ top: 0, left: 0, behavior: 'smooth' }); }; const click = () => { router.push('/contact') currentRoute.value = 'contact' + window.scrollTo({ top: 0, left: 0, behavior: 'smooth' }); }; const clickmainte = () => { router.push('/maintenance') currentRoute.value = 'maintenance' + window.scrollTo({ top: 0, left: 0, behavior: 'smooth' }); }; const scrollInfo = ref({}) const onScroll = (info: any) => { scrollInfo.value = info} +window.onpopstate = function() { + currentRoute.value = 'home' +}; history.pushState({}, ''); +