Skip to content
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

Vue.component(id, component) mismatch type of DefineComponent #12622

Closed
iceprosurface opened this issue Jul 6, 2022 · 0 comments
Closed

Vue.component(id, component) mismatch type of DefineComponent #12622

iceprosurface opened this issue Jul 6, 2022 · 0 comments

Comments

@iceprosurface
Copy link

Version

2.7.2

Steps to reproduce

const ConfigProvider = defineComponent({});
function install(app: VueConstructor) {
  app.component('ConfigProvider', ConfigProvider);
}

This will throw Error:

error TS2345: Argument of type 'DefineComponent<{ getContainer: { type: FunctionConstructor; }; }, Data, Data, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<...>, {}>' is not assignable to parameter of type 'VueConstructor<Vue>'.
  Type 'ComponentPublicInstanceConstructor<{ $data: Data; $props: Readonly<Partial<{}> & Omit<Readonly<ExtractPropTypes<{ getContainer: { type: FunctionConstructor; }; }>>, never>>; ... 10 more ...; $watch(source: string | Function, cb: Function, options?: WatchOptions<...>): WatchStopHandle; } & ... 5 more ... & Readonly<....' is missing the following properties from type 'VueConstructor<Vue>': extend, nextTick, set, delete, and 10 more.

What is expected?

defineComponent({}) return type should match Vue.component(id, component) second params

What is actually happening?

mismatch

Additional comments

Vue2.7.0 works well because of defineComponent which returns VueProxy<{}, RawBindings, D, C, M, Mixin, Extends, Emits>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant