mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +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('*')) {
|
||||
/* istanbul ignore if */
|
||||
if (r.children) {
|
||||
if (path === '' && r.path === '/') {
|
||||
routes.push('/')
|
||||
}
|
||||
flatRoutes(r.children, path + r.path + '/', routes)
|
||||
} else {
|
||||
path = path.replace(/^\/+$/, '/')
|
||||
routes.push((r.path === '' && path[path.length - 1] === '/' ? path.slice(0, -1) : path) + r.path)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user