Description
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 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