Closed
Description
version: "vue-router": "^0.7.13","vue": "^1.0.28"
browser history: index -> list-> detail->buy
buy.vue:
<a @click="back">back</a>
back:()=>history.back()
I confirm user when click the back button
i do this in router because i want prevent the browser's back button too
router.beforeEach(({to, from, next, abort}) => {
let confirm = window.confirm('are you sure to leave this page?')
if(confirm){
abort()
}else{
next()
}
})
I click the back button first time, and abort,do it again.
then i click it the third time,do next,it go index but not detail...