$scopedSlots error with latest version of Vue and Typescript
Closed this issue · 3 comments
RnbWd commented
I'm getting this error:
Property '$scopedSlots' in type 'Component<Props, EventsWithOn, ScopedSlotArgs>' is not assignable to the same property in base type 'object & Record<never, any> & Vue'.
Type 'ScopedSlots<ScopedSlotArgs>' is not assignable to type '{ [key: string]: ScopedSlot | undefined; }'.
Index signatures are incompatible.
Type '(props: any) => string | VNodeChildrenArrayContents' is not assignable to type 'ScopedSlot'.
Type 'string | VNodeChildrenArrayContents' is not assignable to type 'ScopedSlotChildren'.
Type 'VNodeChildrenArrayContents' is not assignable to type 'ScopedSlotChildren'.
Type 'VNodeChildrenArrayContents' is not assignable to type 'ScopedSlotArrayContents'.
Types of property 'pop' are incompatible.
Type '() => string | boolean | VNode | VNodeChildrenArrayContents | [ScopedSlot] | null | undefined' is not assignable to type '() => ScopedSlotChildren'.
Type 'string | boolean | VNode | VNodeChildrenArrayContents | [ScopedSlot] | null | undefined' is not assignable to type 'ScopedSlotChildren'.
Type 'null' is not assignable to type 'ScopedSlotChildren'.
11 | export declare class Component<Props, EventsWithOn = {}, ScopedSlotArgs = {}> extends Vue {
12 | _tsxattrs: TsxComponentAttrs<Props, EventsWithOn, ScopedSlotArgs>;
> 13 | $scopedSlots: ScopedSlots<ScopedSlotArgs>;
| ^
14 | }
15 | /**
16 | * Create component from component options (Compatible with Vue.extend)
Version: typescript 3.2.2
it also throws the same error with typescript 3.1.6
I recently tried to upgrade my project deps, upgrading vue to "2.5.21"
.
RnbWd commented
I think its related to this commit vuejs/vue@448ba65 in vue
wonderful-panda commented
Probably v2.2.2 fix the problem. try it.
RnbWd commented
it works!