We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I import a component created via createComponent into a route in a vue Router, I get the following error.
createComponent
import Page from "/view/Page.vue"; const router = new Router({ mode: "history", routes: [ { path: "/", name: "root", component: Page, }, ]});
Argument of type '{ mode: "history"; base: string | undefined; routes: ({ path: string; name: string; component: typeof Buttons; } | { path: string; name: string; component: typeof NotFound; meta: { public: boolean; }; } | { path: string; name: string; component: typeof Unauthorized; props: true; meta: { ...; }; } | { ...; })[]; }' is not assignable to parameter of type 'RouterOptions'. Types of property 'routes' are incompatible. Type '({ path: string; name: string; component: typeof Buttons; } | { path: string; name: string; component: typeof NotFound; meta: { public: boolean; }; } | { path: string; name: string; component: typeof Unauthorized; props: true; meta: { ...; }; } | { ...; })[]' is not assignable to type 'RouteConfig[]'. Type '{ path: string; name: string; component: typeof Buttons; } | { path: string; name: string; component: typeof NotFound; meta: { public: boolean; }; } | { path: string; name: string; component: typeof Unauthorized; props: true; meta: { ...; }; } | { ...; }' is not assignable to type 'RouteConfig'. Type '{ path: string; name: string; component: VueProxy<{ url: StringConstructor; }, void>; props: true; meta: { public: boolean; }; }' is not assignable to type 'RouteConfig'. Types of property 'component' are incompatible. Type 'VueProxy<{ url: StringConstructor; }, void>' is not assignable to type 'VueConstructor<Vue> | ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<string, any>> | AsyncComponentPromise<...> | AsyncComponentFactory<...> | undefined'. Type 'ComponentOptions<never, void, never, never, { url: StringConstructor; }, ExtractPropTypes<{ url: StringConstructor; }, false>> & VueConstructorProxy<{ url: StringConstructor; }, void>' is missing the following properties from type 'VueConstructor<Vue>': extend, nextTick, set, delete, and 9 more.
I can get rid of the error by manually setting the type to VueConstructor:
import Page from "/view/Page.vue"; const router = new Router({ mode: "history", routes: [ { path: "/", name: "root", component: Page as Vue.VueConstructor, }, ]});
It appears createComponent isn't returning a compatible type? I'm on typescript 3.6.2 and Vue Router 3.1.3.
The text was updated successfully, but these errors were encountered:
bb8f2fd
No branches or pull requests
When I import a component created via
createComponent
into a route in a vue Router, I get the following error.I can get rid of the error by manually setting the type to VueConstructor:
It appears createComponent isn't returning a compatible type? I'm on typescript 3.6.2 and Vue Router 3.1.3.
The text was updated successfully, but these errors were encountered: