Vue 切换路由后页面回到页面顶部
backTop() {window.scrollTo(0, 0)document.body.scrollTop = 0document.documentElement.scrollTop = 0}
router.beforeEach((to, from, next) => {if (to.meta.title) {document.title = to.meta.title}setTimeout(() => {window.scrollTo(0, 0)document.body.scrollTop = 0document.documentElement.scrollTop = 0}, 100)next()})