mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
feat(utils): export sort routes (#6277)
This commit is contained in:
parent
93a0924754
commit
0daaf87c83
@ -74,7 +74,7 @@ function cleanChildrenRoutes (routes, isChild = false, routeNameSplitter = '-')
|
|||||||
|
|
||||||
const DYNAMIC_ROUTE_REGEX = /^\/([:*])/
|
const DYNAMIC_ROUTE_REGEX = /^\/([:*])/
|
||||||
|
|
||||||
const sortRoutes = function sortRoutes (routes) {
|
export const sortRoutes = function sortRoutes (routes) {
|
||||||
routes.sort((a, b) => {
|
routes.sort((a, b) => {
|
||||||
if (!a.path.length) {
|
if (!a.path.length) {
|
||||||
return -1
|
return -1
|
||||||
|
Loading…
Reference in New Issue
Block a user