优化首页返回定位与发布在线时间表单
移动端首页用列表缓存和内部滚动恢复浏览位置;发布页在线时间改为全天+起止时间单行布局。
This commit is contained in:
@@ -14,13 +14,9 @@ import { sellerRoutes } from './sellerRoutes'
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: [...adminRoutes, ...mobileRoutes, ...publicRoutes, ...accountRoutes, ...sellerRoutes],
|
||||
scrollBehavior(to, _from, savedPosition) {
|
||||
// 浏览器前进/后退优先用历史滚动位置
|
||||
scrollBehavior(_to, _from, savedPosition) {
|
||||
// 浏览器前进/后退用历史滚动;移动端首页列表在内部容器滚动,不依赖 window
|
||||
if (savedPosition) return savedPosition
|
||||
// 移动端首页由 KeepAlive + 组件内自行恢复滚动,避免被强制拉回顶部
|
||||
if (to.name === 'mobile-home' || to.name === 'mobile-listings') {
|
||||
return false
|
||||
}
|
||||
return { left: 0, top: 0 }
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user