页面销毁清空stroe数据
// 1.挂载完成后,判断是否支持popstate
mounted () {
if (window.history && window.history.pushState) {
history.pushState(null, null, document.URL)
window.addEventListener('popstate', this.onClickLeft, false)
}
},
// 2.页面销毁时,取消监听,否则其他vue路由页面也会被监听
destroyed () {
window.removeEventListener('popstate', this.onClickLeft, false)
},