Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

docs: use RouterConfig interface in examples #8151

Merged
merged 1 commit into from Oct 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/content/2.guide/2.directory-structure/1.pages.md
Expand Up @@ -335,10 +335,10 @@ It is possible to customize [vue-router options](https://router.vuejs.org/api/in
This is the recommended way to specify router options.

```js [app/router.options.ts]
import type { RouterOptions } from '@nuxt/schema'
import type { RouterConfig } from '@nuxt/schema'

// https://router.vuejs.org/api/interfaces/routeroptions.html
export default <RouterOptions> {
export default <RouterConfig> {
}
```

Expand All @@ -348,10 +348,10 @@ You can optionally override routes using a function that accepts scanned routes
If returning `null` or `undefined`, Nuxt will fallback to the default routes. (useful to modify input array)

```js [app/router.options.ts]
import type { RouterOptions } from '@nuxt/schema'
import type { RouterConfig } from '@nuxt/schema'

// https://router.vuejs.org/api/interfaces/routeroptions.html
export default <RouterOptions> {
export default <RouterConfig> {
routes: (_routes) => [
{
name: 'home',
Expand All @@ -368,11 +368,11 @@ You can optionally override history mode using a function that accepts base url
If returning `null` or `undefined`, Nuxt will fallback to the default history.

```js [app/router.options.ts]
import type { RouterOptions } from '@nuxt/schema'
import type { RouterConfig } from '@nuxt/schema'
import { createMemoryHistory } from 'vue-router'

// https://router.vuejs.org/api/interfaces/routeroptions.html
export default <RouterOptions> {
export default <RouterConfig> {
history: base => process.client ? createMemoryHistory(base) : null /* default */
}
```
Expand Down