// 组件守护器 beforeRouteEnter(to, from, next) { // A跳转到B,B页面停留在A页面的滚动位置;解决方法:将scrollTop设置为0 window.scroll(0, 0); next(); },