vue-router scrollBehavior无效的问题(vue-router,路由跳转滚动条置顶)

mac2022-06-30  12

const router = new Router({ routes:[ { path:"/", name:'index' commponent:pcLayout, }, .... ] }) router.beforeEach((to, from, next) => { document.body.scrollTop = 0; next() }); export default router
最新回复(0)