You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vue-router has a method addRoutes that allows to dynamically add routes. However, it is currently not possible to add child routes to an existing route as far as I can see. It would be nice if addRoutes could have a second parameter parent or if you could introduce a new addChildRoutes method.
What I am trying to achieve is create a route for a product, let's say '/products/productA' pointing to a component that dynamically adds child routes in its beforeCreate so that in the end, I can navigate to '/products/productA/settings', '/products/productA/dashboard' etc. without the main router config knowing about every route each product has.
What is expected?
addRoute should offer a second parameter called parent so one can add child routes
What is actually happening?
addRoute does not support adding child routes to routes already defined
The text was updated successfully, but these errors were encountered:
Version
3.0.1
Reproduction link
https://jsfiddle.net/qv9z3x99/
Steps to reproduce
vue-router has a method
addRoutes
that allows to dynamically add routes. However, it is currently not possible to add child routes to an existing route as far as I can see. It would be nice ifaddRoutes
could have a second parameterparent
or if you could introduce a newaddChildRoutes
method.What I am trying to achieve is create a route for a product, let's say '/products/productA' pointing to a component that dynamically adds child routes in its
beforeCreate
so that in the end, I can navigate to '/products/productA/settings', '/products/productA/dashboard' etc. without the main router config knowing about every route each product has.What is expected?
addRoute
should offer a second parameter calledparent
so one can add child routesWhat is actually happening?
addRoute
does not support adding child routes to routes already definedThe text was updated successfully, but these errors were encountered: