Skip to content

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

@iceprosurface

Description

@iceprosurface

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions