We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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
The text was updated successfully, but these errors were encountered:
Thanks for filling this issue. Closing as it's a duplicate of #853
Sorry, something went wrong.
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: