fix scroll

This commit is contained in:
jxxghp
2023-06-29 23:12:43 +08:00
parent 523f4f1cc6
commit 175654297a
2 changed files with 9 additions and 1 deletions

View File

@@ -3,6 +3,10 @@ import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
scrollBehavior(to, from, savedPosition) {
// 始终滚动到顶部
return { top: 0 }
},
routes: [
{ path: '/', redirect: '/dashboard' },
{