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
When routes are added via the addRoute action, it's difficult to control the priority of the routes added. The toBottom parameter doesn't work well because if other services call addRoute later, their routes will be added below.
This is a problem especially when there are catch-all routes which must imperatively be handled at the very end.
A solution could be to set a priority option (as a number) to routes. Higher-priority routes would bypass lower-priority routes in the optimizeRouteOrder method.
What do you think ?
For now I've found a temporary solution by adding a catchAll option to routes and overwriting the optimizeRouteOrder method to ensure these catch-all routes are handled last:
methods: {optimizeRouteOrder(){// Overwrite optimization method to put catchAll routes at the endthis.routes.sort((a,b)=>(a.opts.catchAll ? 1 : -1));this.aliases.sort((a,b)=>(a.route.opts.catchAll ? 1 : -1));},}
The text was updated successfully, but these errors were encountered:
When routes are added via the
addRoute
action, it's difficult to control the priority of the routes added. ThetoBottom
parameter doesn't work well because if other services calladdRoute
later, their routes will be added below.This is a problem especially when there are catch-all routes which must imperatively be handled at the very end.
A solution could be to set a
priority
option (as a number) to routes. Higher-priority routes would bypass lower-priority routes in theoptimizeRouteOrder
method.What do you think ?
For now I've found a temporary solution by adding a
catchAll
option to routes and overwriting theoptimizeRouteOrder
method to ensure these catch-all routes are handled last:The text was updated successfully, but these errors were encountered: