I am trying to extract the base path of a route in my Vue Router interceptor without including its parameters.
router.beforeEach((to, from, next) => {
console.log(to);
})
For example, if the route is /profile/abc/def
where abc
and def
are dynamic parameters, I want to only retrieve /profile
in my interceptor without the parameters. Can anyone suggest how I can achieve this?