Vue · Senior · Question 41 of 75
When would you call router.addRoute()?
- ✓Correct answer: To register routes at runtime, e.g. modules enabled per tenant or plugin-provided pages
- 2To navigate to a new page
- 3To preload route components
Explanation
If you add a route matching the current location, navigate again (router.replace(router.currentRoute.value.fullPath)) so it takes effect. removeRoute deletes it.