vue A页面如何条用B页面的方法
1、如果页面A沿Y轴滚动一段距离,然后跳转到页面B;在进入B页面时,B页面已经滚到页面A的距离,返回页面A,发现A还在之前的滚动位置

3、// 全局路由守卫router.beforeEach((to, from, next) => { // to: Route: 即将要进入的目标 路由对象

5、// A跳转到B,B页面停留在A页面的滚动位置;解决方法:将scrollTop设置为0 window.scroll(0, 0);

6、// nextRoute: 设置需要路由守卫的路由集合 const nextRoute = ['home', 'good-list', 'good-detail', 'cart', 'profile'];
