mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
Merge branch 'master' into feature-layout
This commit is contained in:
commit
854573a7ad
@ -211,11 +211,12 @@ function createRoutes (files, srcDir) {
|
|||||||
})
|
})
|
||||||
route._name = '_' + hash(route.component)
|
route._name = '_' + hash(route.component)
|
||||||
// Order Routes path
|
// Order Routes path
|
||||||
if (_.last(keys)[0] === '_') {
|
|
||||||
parent.push(route)
|
parent.push(route)
|
||||||
} else {
|
parent.sort((a, b) => {
|
||||||
parent.unshift(route)
|
var isA = (a.path[0] === ':' || a.path[1] === ':') ? 1 : 0
|
||||||
}
|
var isB = (b.path[0] === ':' || b.path[1] === ':') ? 1 : 0
|
||||||
|
return (isA - isB === 0) ? a.path.length - b.path.length : isA - isB
|
||||||
|
})
|
||||||
})
|
})
|
||||||
return cleanChildrenRoutes(routes)
|
return cleanChildrenRoutes(routes)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user