ตั้งค่าตรงกดปุ่มย้อนกลับตรง browser
This commit is contained in:
parent
88fb7dc71a
commit
b3a8f54f37
1 changed files with 8 additions and 0 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue