mounted(){
if (window.history && window.history.pushState) {
history.pushState(null, null, document.URL);
window.addEventListener('popstate', this.fun, false);//false阻止默认事件
}
},
destroyed(){
window.removeEventListener('popstate', this.fun, false);//false阻止默认事件
},
methods:{
fun(){
console.log("监听到了");
}
}