mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
fix(schema): fix RouterConfig types (#3964)
This commit is contained in:
parent
c28c6a8c8a
commit
7e6c4e2d5b
@ -274,10 +274,10 @@ It is possible to set default [vue-router options](https://router.vuejs.org/api/
|
||||
This is the recommaned 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/#routeroptions
|
||||
export default <RouterOptions>{
|
||||
export default <RouterConfig>{
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -9,7 +9,7 @@ export default {
|
||||
* For more control, you can use `app/router.optionts.ts` file.
|
||||
*
|
||||
* @see [documentation](https://router.vuejs.org/api/#routeroptions)
|
||||
* @type {import('../src/types/router').RouterConfigOptions}
|
||||
* @type {import('../src/types/router').RouterConfigSerializable}
|
||||
*
|
||||
* @version 3
|
||||
*/
|
||||
|
@ -1,9 +1,16 @@
|
||||
import type { RouterOptions as _RouterOptions } from 'vue-router'
|
||||
|
||||
|
||||
export type RouterOptions = Exclude<_RouterOptions, 'history' | 'routes'>
|
||||
export type RouterConfig = Partial<Omit<_RouterOptions, 'history' | 'routes'>>
|
||||
|
||||
/** @deprecated Use RouterConfig instead */
|
||||
export type RouterOptions = RouterConfig
|
||||
|
||||
/**
|
||||
* Only JSON serializable router options are configurable from nuxt config
|
||||
*/
|
||||
export type RouterConfigOptions = Pick<RouterOptions, 'linkActiveClass' | 'linkExactActiveClass' | 'end' | 'sensitive' | 'strict'>
|
||||
export type RouterConfigSerializable = Pick<RouterConfig, 'linkActiveClass' | 'linkExactActiveClass' | 'end' | 'sensitive' | 'strict'>
|
||||
|
||||
|
||||
/** @deprecated Use RouterConfigSerializable instead */
|
||||
export type RouterConfigOptions = RouterConfigSerializable
|
||||
|
Loading…
Reference in New Issue
Block a user