//赋值记录的高度
function scrollToAssign(label, _this,h) {
_this.$nextTick(() => {
const container = _this.$el.querySelector(`.${label}`);
container.scrollTop = h;
});
}
//离开该页面的时候把高度记录
beforeRouteLeave (to, from, next) {
this.scrollTop = this.$el.querySelector('.common-main-style').scrollTop || document.body.scrollTop;
next()
},
activated() {
scrollToAssign('common-main-style', this, this.scrollTop)
}