首先
mounted(){
if (window.history && window.history.pushState) {
history.pushState(null, null, document.URL);
window.addEventListener('popstate', this.cancel, false);
}
},
然后
cancel() {
this.$router.push({
name:"orderList",
query: {
pageSize: this.$route.query.pageSize,
status: this.$route.query.status,
}
});
},
最后销毁
destroyed(){
window.removeEventListener('popstate', this.cancel, false);
}
网友评论