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