修复下一页图标不显示问题,增加缓存前端配置页面
This commit is contained in:
+18
-1
@@ -63,7 +63,24 @@ const router = createRouter({
|
||||
component: () => import('@/views/BookmarksView.vue'),
|
||||
meta: { requiresAuth: true }
|
||||
}
|
||||
]
|
||||
],
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
// 如果有保存的位置(浏览器前进/后退),则恢复到该位置
|
||||
if (savedPosition) {
|
||||
return savedPosition
|
||||
}
|
||||
|
||||
// 如果有锚点,则滚动到锚点位置
|
||||
if (to.hash) {
|
||||
return {
|
||||
el: to.hash,
|
||||
behavior: 'smooth'
|
||||
}
|
||||
}
|
||||
|
||||
// 否则滚动到页面顶部
|
||||
return { top: 0 }
|
||||
}
|
||||
})
|
||||
|
||||
// 路由守卫
|
||||
|
||||
Reference in New Issue
Block a user