When writing a menu, it's common to highlight or otherwise show as "active" the menu option which corresponds to the current route.
Libraries like PrimeVue allow you to specify a RouteLocationRaw when defining a menu option, as that's the "user facing" interface for defining a route to go to. So when writing your own menu, you need to somehow compare a RouteLocationRaw to the currentRoute, which is a RouteLocationNormalizedLoaded. But those two interfaces are wildly different, making comparison fraught with error.
VueRouter already must implement this comparison, since if you try to navigate to a RouteLocationRaw that goes to the same route, you get a navigation failure. But it doesn't expose any methods to allow this.
Proposed solution
Some ideas I have are:
Expose a method for turning a RouteLocationRaw into a RouteLocationNormalized, making comparison straightforward.
Add a router.test(route: RouteLocationRaw) method that lets you see what the result of navigation would be if you took it, but which does not cause any routing to actually happen.
What problem is this solving
When writing a menu, it's common to highlight or otherwise show as "active" the menu option which corresponds to the current route.
Libraries like PrimeVue allow you to specify a RouteLocationRaw when defining a menu option, as that's the "user facing" interface for defining a route to go to. So when writing your own menu, you need to somehow compare a RouteLocationRaw to the currentRoute, which is a RouteLocationNormalizedLoaded. But those two interfaces are wildly different, making comparison fraught with error.
VueRouter already must implement this comparison, since if you try to navigate to a RouteLocationRaw that goes to the same route, you get a navigation failure. But it doesn't expose any methods to allow this.
Proposed solution
Some ideas I have are:
Describe alternatives you've considered
No response