/**
* @internal
*/
-export interface LocationAsRelativeRaw {
- name?: {} extends NamedLocationMap ? RouteRecordName : keyof NamedLocationMap
- params?: RouteParamsRaw
+export interface LocationAsRelativeRaw<
+ T extends keyof NamedLocationMap = keyof NamedLocationMap
+> {
+ name?: {} extends NamedLocationMap ? RouteRecordName : T
+ params?: {} extends NamedLocationMap ? RouteParamsRaw : NamedLocationMap[T]
}
export interface LocationAsRelative {
*/
redirect?: RouteRecordRedirectOption
+ /**
+ * Array of nested routes.
+ */
+ children?: RouteRecordRaw[] | Readonly<RouteRecordRaw[]>
/**
* Aliases for the record. Allows defining extra paths that will behave like a
* copy of the record. Allows having paths shorthands like `/users/:id` and
type TypedRoutes = ExtractNamedRoutes<typeof routes>
declare module './index' {
- interface NamedLocationMap extends TypedRoutes {}
+ interface NamedLocationMap {
+ 'my-other-path': {
+ sss: number
+ }
+ }
}
declare const router: Router
router.push({
name: 'my-other-path',
+ params: {
+ sss: 1,
+ // @ts-expect-error
+ xxxx: '22',
+ },
})
router.push({