在main.js 中 监听函数
mounted(){
window.addEventListener('popstate', this.popstate)
}
beforeDestroyed() {
// 清除popstate事件
window.removeEventListener("popstate", this.popstate)
},
methods:{
popstate(){
history.pushState(null, null, document.URL)
}
},