mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
docs: use RouterConfig
interface in examples (#8151)
This commit is contained in:
parent
e45372c4ce
commit
d4eb15aa77
@ -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 */
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user