mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
fix: generate pages/index/**
This commit is contained in:
parent
32e67c7481
commit
9163e48589
@ -150,8 +150,12 @@ export function flatRoutes(router, path = '', routes = []) {
|
|||||||
if (!r.path.includes(':') && !r.path.includes('*')) {
|
if (!r.path.includes(':') && !r.path.includes('*')) {
|
||||||
/* istanbul ignore if */
|
/* istanbul ignore if */
|
||||||
if (r.children) {
|
if (r.children) {
|
||||||
|
if (path === '' && r.path === '/') {
|
||||||
|
routes.push('/')
|
||||||
|
}
|
||||||
flatRoutes(r.children, path + r.path + '/', routes)
|
flatRoutes(r.children, path + r.path + '/', routes)
|
||||||
} else {
|
} else {
|
||||||
|
path = path.replace(/^\/+$/, '/')
|
||||||
routes.push((r.path === '' && path[path.length - 1] === '/' ? path.slice(0, -1) : path) + r.path)
|
routes.push((r.path === '' && path[path.length - 1] === '/' ? path.slice(0, -1) : path) + r.path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user