Sort routes to ensure the client router always matches correctly
This commit is contained in:
parent
3c6be9d481
commit
a926b23720
|
@ -21,6 +21,12 @@ const createRouteStore = () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Sort route by paths so that the router matches correctly
|
||||||
|
routes.sort((a, b) => {
|
||||||
|
return a.path > b.path ? -1 : 1
|
||||||
|
})
|
||||||
|
|
||||||
store.update(state => {
|
store.update(state => {
|
||||||
state.routes = routes
|
state.routes = routes
|
||||||
return state
|
return state
|
||||||
|
|
Loading…
Reference in New Issue