const router = new Router({
routes:[
{
path:"/",
name:'index'
commponent:pcLayout,
},
....
]
})
router.beforeEach((to, from, next) => {
document.body.scrollTop = 0;
next()
});
export default router
vue-router scrollBehavior无效的问题(vue-router,路由跳转滚动条置顶)
最新推荐文章于 2024-01-09 10:31:40 发布