wonderful-panda/vue-tsx-support

Converting a component with `convert` not returning a correct type

Closed this issue · 4 comments

In 2.1.1, using the below code:

export const VAvatar = ofType<Props, Events, ScopedSlots>().convert(
  VueAvatarOriginal,
);

the type of VAvatar is like the following:

const VAvatar: VueConstructor<{
    _tsxattrs: TsxComponentAttrs<Props, Events, ScopedSlots>;
} & Vue>

but when I use with 2.2.0

the type of VAvatar is like the following instead:

const VAvatar: VueConstructor<any>

I've made a repo here https://github.com/chanlito/vue-tsx-support-convert-type-bug showing this issue.

Sorry, I have no time to fix this problem now.

This is a workaround for now.

const Avatar = ofType<Props, Events>().convert(require('vue-avatar').Avatar as typeof Vue);

Fixed in v2.2.1

@wonderful-panda - is this related #48