mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 16:43:55 +00:00
fix pathToRegexp generate routes
This commit is contained in:
parent
591ef50a06
commit
749673c99b
@ -67,10 +67,9 @@ export default function () {
|
|||||||
console.error(`Could not generate the dynamic route ${route}, please add the mapping params in nuxt.config.js (generate.routeParams).`) // eslint-disable-line no-console
|
console.error(`Could not generate the dynamic route ${route}, please add the mapping params in nuxt.config.js (generate.routeParams).`) // eslint-disable-line no-console
|
||||||
return process.exit(1)
|
return process.exit(1)
|
||||||
}
|
}
|
||||||
route = route + '?'
|
const toPathRegexp = pathToRegexp.compile(route)
|
||||||
const toPath = pathToRegexp.compile(route)
|
|
||||||
routes = routes.concat(routeParams.map((params) => {
|
routes = routes.concat(routeParams.map((params) => {
|
||||||
return toPath(params)
|
return toPathRegexp(params)
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
routes.push(route)
|
routes.push(route)
|
||||||
|
Loading…
Reference in New Issue
Block a user