Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the hash mode, press the browser back button is not work #933

Closed
ml-milkmidi opened this issue Nov 24, 2016 · 1 comment
Closed

In the hash mode, press the browser back button is not work #933

ml-milkmidi opened this issue Nov 24, 2016 · 1 comment

Comments

@ml-milkmidi
Copy link

sample code
https://router.vuejs.org/en/advanced/meta.html

const router = new VueRouter( {
mode: 'hash' // back button not work
//mode: 'history' // it's work
})

router.beforeEach((to, from, next) => {
console.log(to); // not toggle log ????????????
if (to.matched.some(record => record.meta.requiresAuth)) {
if (!auth.loggedIn()) {
next({
path: '/login',
query: { redirect: to.fullPath }
})
} else {
next()
}
} else {
next() // make sure to always call next()!
}
})

Thanks

@fnlctrl
Copy link
Member

fnlctrl commented Nov 24, 2016

Thanks for filling this issue. Closing as it's a duplicate of #853

@fnlctrl fnlctrl closed this as completed Nov 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants