docs: use RouterConfig interface in examples (#8151)

This commit is contained in:
Won-hyeok Jung 2022-10-13 19:53:50 +09:00 committed by GitHub
parent e45372c4ce
commit d4eb15aa77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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> {
}
```
@ -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',
@ -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 */
}
```