Bug:A页面路由跳转B页面后,“滚动条下拉到底部加载更多”事件移除未生效,在B页面滚动条下拉到底部还是一直在请求A页面的接口。
代码如下:
methods: {
//点击事件路由跳转B页面
goCommodityDetails(e){
window.removeEventListener('scroll', this.addEventScrollTop ,true)
this.$router.push({
path: '/commodityDetails',
query: {
t: Math.random(),
id: e.id
}
});
},
},
created () {
window.addEventListener('scroll', this.addEventScrollTop ,true)
},
mounted () {
},
updated() {
},
destroyed(){
window.removeEventListener('scroll', this.addEventScrollTop ,true)
}
同样的问题,刚刚解决