-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interface RouteConfig is not exported anymore #3234
Comments
|
I think this could be helpful So I can maybe do something like this: export default interface RouteMetaConfigSingleView extends RouteConfigSingleView {
meta?: RouteMetaInformation;
}
export default interface RouteMetaConfigMultipleViews extends RouteConfigMultipleViews {
meta?: RouteMetaInformation;
children?: RouteMetaConfig[];
}
export type RouteMetaConfig = RouteMetaConfigSingleView | RouteMetaConfigMultipleViews; But maybe my problem is related to #3183 interface _RouteConfigBase<Meta = any> {
path: string
name?: string
redirect?: RedirectOption
alias?: string | string[]
meta?: Meta
beforeEnter?: NavigationGuard
caseSensitive?: boolean
pathToRegexpOptions?: PathToRegexpOptions
}
export interface RouteConfigSingleView<Meta = any> extends _RouteConfigBase<Meta> {
component?: Component
props?: boolean | Object | RoutePropsFunction
}
export interface RouteConfigMultipleViews<Meta = any> extends _RouteConfigBase<Meta> {
components?: Dictionary<Component>
children?: RouteConfig[]
props?: Dictionary<boolean | Object | RoutePropsFunction>
}
export type RouteConfig<Meta = any> = RouteConfigSingleView<Meta> | RouteConfigMultipleViews<Meta> Problem with that: each e.g. { hideInNavi?: boolean, breadcrumb?: string } |
Adding a generic to the type should go through an RFC because is not that simple of a change. If anybody is interested in leading that, please do at https://github.com/vuejs/rfcs. As noted, take into account what has been said at #3183 |
#3183 (comment) This idea could resolve my problem |
Cause nothing has changed until now, I have rewritten my code as following: import { RouteConfigMultipleViews, RouteConfigSingleView } from 'vue-router/types/router';
import RouteMetaInformation from './RouteMetaInformation';
export interface RouteMetaConfigSingleView extends RouteConfigSingleView {
meta?: RouteMetaInformation;
children?: RouteMetaConfig[];
}
export interface RouteMetaConfigMultipleViews extends RouteConfigMultipleViews {
meta?: RouteMetaInformation;
children?: RouteMetaConfig[];
}
/**
* RouteConfig using RouteMetaInformation.
*/
export type RouteMetaConfig = RouteMetaConfigSingleView | RouteMetaConfigMultipleViews; You can close this issue if you want |
Version
3.3.3
Reproduction link
Please see
Steps to reproduce
belowSteps to reproduce
What is expected?
RouterConfig
/RouterConfigBase
should be exported so consumer canextends
from ithttps://github.com/vuejs/vue-router/blob/v3.3.2/types/router.d.ts#L92
What is actually happening?
_RouterConfigBase
is not exported anymorehttps://github.com/vuejs/vue-router/blob/v3.3.3/types/router.d.ts#L92
The text was updated successfully, but these errors were encountered: