Configuration
export default defineNuxtConfig({
pagesPlus: {
// Nuxt Pages Plus configuration
}
})
separator
- Type:
string - Default:
@
The separator is used to split the parallel route name and the page name. Please read the Directory Structure > Escape @ eparator for more information.
namedViewsAsParallelRoutes
- Type:
boolean - Default:
false
Nuxt >= 4.5 parses name@view.vue page files as vue-router named views instead of emitting standalone routes, so Nuxt Pages Plus can no longer detect them as parallel routes by default.
Enable this option to keep treating name@view.vue files as parallel routes, like older Nuxt versions did:
export default defineNuxtConfig({
pagesPlus: {
namedViewsAsParallelRoutes: true,
},
})
Notes:
- This option only takes effect on Nuxt
>= 4.5with the default@separator. Older Nuxt versions always emitname@view.vuefiles as parallel routes, regardless of this option. - When this option is not set and
name@view.vuefiles are detected as named views, a warning will be printed during build. Set the option tofalseexplicitly to keep using Nuxt's native named views and dismiss the warning. - Directory style parallel routes (e.g.
@foo/index.vue) and custom separators (e.g.index+foo.vue) are not affected by Nuxt's named views and work without this option.
parallelPages
- Type:
Record<string, ParallelPageOptions> - Default:
{}
You can configure every parallel route in your project using this option.
The key is the parallel route name, for example you have a ~/pages/@foo parallel route, the key should be foo.
ParallelPageOptions
interface ParallelPageOptions {
mode: 'sync' | 'sync-once' | 'manual' // default: 'sync'
index?: string // default: undefined
fallback: boolean | { redirect?: string } // default: true
}
mode
- Type:
'sync' | 'sync-once' | 'manual' - Default:
sync
The sync mode of the parallel route. Please read the Parallel Routes > Sync Modes for more information.
index
- Type:
string | undefined - Default:
/~index
The index page of the parallel route. Please read the Parallel Routes > Fallback Mechanism for more information.
fallback
- Type:
boolean | { redirect?: string } - Default:
true
The fallback mechanism of the parallel route. Please read the Parallel Routes > Fallback Mechanism for more information.
Installation
Install Nuxt Pages Plus to your Nuxt project using a single line of command using nuxi as shown below.
Directory Structure
All named parallel routes page files should be placed in the ~/pages/ directory. Nuxt Pages Plus will process these files and generate parallel routes after Nuxt has generated the routes.