ตั้งค่าตรงกดปุ่มย้อนกลับตรง 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)
|
router.push(val)
|
||||||
currentRoute.value = val
|
currentRoute.value = val
|
||||||
tab.value=val
|
tab.value=val
|
||||||
|
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
|
||||||
};
|
};
|
||||||
|
|
||||||
const clickTab= (val2: string) => {
|
const clickTab= (val2: string) => {
|
||||||
|
|
@ -68,21 +69,28 @@ const clickTab= (val2: string) => {
|
||||||
const goHome = () => {
|
const goHome = () => {
|
||||||
router.push('/')
|
router.push('/')
|
||||||
currentRoute.value = 'home'
|
currentRoute.value = 'home'
|
||||||
|
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
|
||||||
};
|
};
|
||||||
|
|
||||||
const click = () => {
|
const click = () => {
|
||||||
router.push('/contact')
|
router.push('/contact')
|
||||||
currentRoute.value = 'contact'
|
currentRoute.value = 'contact'
|
||||||
|
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
|
||||||
};
|
};
|
||||||
|
|
||||||
const clickmainte = () => {
|
const clickmainte = () => {
|
||||||
router.push('/maintenance')
|
router.push('/maintenance')
|
||||||
currentRoute.value = 'maintenance'
|
currentRoute.value = 'maintenance'
|
||||||
|
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
|
||||||
};
|
};
|
||||||
|
|
||||||
const scrollInfo = ref({})
|
const scrollInfo = ref({})
|
||||||
const onScroll = (info: any) => { scrollInfo.value = info}
|
const onScroll = (info: any) => { scrollInfo.value = info}
|
||||||
|
|
||||||
|
window.onpopstate = function() {
|
||||||
|
currentRoute.value = 'home'
|
||||||
|
}; history.pushState({}, '');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<!-- โครงเว็บ -->
|
<!-- โครงเว็บ -->
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue