From b3a8f54f37ffa2dfaad286c9b401ce9e61205bf1 Mon Sep 17 00:00:00 2001 From: Tanyalak Date: Thu, 21 Dec 2023 16:30:22 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=95=E0=B8=B1=E0=B9=89=E0=B8=87=E0=B8=84?= =?UTF-8?q?=E0=B9=88=E0=B8=B2=E0=B8=95=E0=B8=A3=E0=B8=87=E0=B8=81=E0=B8=94?= =?UTF-8?q?=E0=B8=9B=E0=B8=B8=E0=B9=88=E0=B8=A1=E0=B8=A2=E0=B9=89=E0=B8=AD?= =?UTF-8?q?=E0=B8=99=E0=B8=81=E0=B8=A5=E0=B8=B1=E0=B8=9A=E0=B8=95=E0=B8=A3?= =?UTF-8?q?=E0=B8=87=20browser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/MainLayout.vue | 8 ++++++++ 1 file changed, 8 insertions(+) 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({}, ''); +