路由设置
{
path: '/Followlist',
name: 'Followlist',
component: resolve => require(['@/views/Followlist.vue'], resolve)
}
<keep-alive include='Followlist'>
<router-view />
</keep-alive>
html 代码 Followlist.vue
<div class="oa-content" ref="wrapper" @scroll="handlerScroll"> ...........你的内容</div>
css代码
.oa-content {
overflow-x: hidden;
overflow-y: scroll;
position: relative;
}
js代码
data() {
return {
scrollTop: 0,
};
},
activated() {
console.log(this.scroll)
this.$refs.wrapper.scrollTop = this.scrollTop;
},
methods: {
handlerScroll(e) {
this.scrollTop= e.target.scrollTop;
}
}