mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 07:32:01 +00:00
feat: route alias support (#4273)
This commit is contained in:
parent
02b148ae2c
commit
85f2f83cf2
@ -277,6 +277,10 @@ You can define middleware to apply before loading this page. It will be merged w
|
|||||||
|
|
||||||
You can define transition properties for the `<transition>` components that wraps your pages and layouts, or pass `false` to disable the `<transition>` wrapper for that route. You can see a list of options that can be passed [here](https://vuejs.org/api/built-in-components.html#transition) or read [more about how transitions work](https://vuejs.org/guide/built-ins/transition.html#transition).
|
You can define transition properties for the `<transition>` components that wraps your pages and layouts, or pass `false` to disable the `<transition>` wrapper for that route. You can see a list of options that can be passed [here](https://vuejs.org/api/built-in-components.html#transition) or read [more about how transitions work](https://vuejs.org/guide/built-ins/transition.html#transition).
|
||||||
|
|
||||||
|
#### `alias`
|
||||||
|
|
||||||
|
You can define page aliases. They allow you to access the same page from different paths. It can be either a string or an array of string as defined [here](https://router.vuejs.org/guide/essentials/redirect-and-alias.html#alias) on vue-router documentation.
|
||||||
|
|
||||||
## Navigation
|
## Navigation
|
||||||
|
|
||||||
To navigate between pages of your app, you should use the [`<NuxtLink>`](/api/components/nuxt-link) component.
|
To navigate between pages of your app, you should use the [`<NuxtLink>`](/api/components/nuxt-link) component.
|
||||||
|
@ -237,6 +237,7 @@ export function normalizeRoutes (routes: NuxtPage[], metaImports: Set<string> =
|
|||||||
...Object.fromEntries(Object.entries(route).map(([key, value]) => [key, JSON.stringify(value)])),
|
...Object.fromEntries(Object.entries(route).map(([key, value]) => [key, JSON.stringify(value)])),
|
||||||
children: route.children ? normalizeRoutes(route.children, metaImports).routes : [],
|
children: route.children ? normalizeRoutes(route.children, metaImports).routes : [],
|
||||||
meta: route.meta ? `{...(${metaImportName} || {}), ...${JSON.stringify(route.meta)}}` : metaImportName,
|
meta: route.meta ? `{...(${metaImportName} || {}), ...${JSON.stringify(route.meta)}}` : metaImportName,
|
||||||
|
alias: `${metaImportName}.alias || []`,
|
||||||
component: genDynamicImport(file)
|
component: genDynamicImport(file)
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
Loading…
Reference in New Issue
Block a user