I have a Vue Router routes setup like so:
[
{
path: '/regions',
name: 'regions',
component: () => import(/* webpackChunkName: "regions" */ '../views/RegionsView.vue'),
props: {
endpoint: '/admin/regions/index'
},
meta: {
auth: true,
role: ['admin'],
permission: 'region-view'
}
}
]
I’m trying to access props
from the route in the beforeEach()
function, how can I do this?
router.beforeEach((
to: RouteLocationNormalized,
from: RouteLocationNormalized,
next: NavigationGuardNext
) => {
// console.log(to.props)???
next()
})