ตั้งค่าตรงกดปุ่มย้อนกลับตรง browser

This commit is contained in:
Tanyalak 2023-12-21 16:30:22 +07:00
parent 88fb7dc71a
commit b3a8f54f37

View file

@ -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({}, '');
</script>
<!-- โครงเว -->
<template>