Subscribe on changes!

In createSlots method, No slotType compatible for numeric definition cases

avatar
Jul 12th 2022

Vue version

latest

Link to minimal reproduction

https://github.com/vuejs/core/blob/8dcb6c7bbdd2905469e2bb11dfff27b58cc784b2/packages/runtime-core/__tests__/componentSlots.spec.ts#L100

Steps to reproduce

As you can see (and test) in creating slots in the VUE test case, is the type definition not compatible when slotType is numeric?

Now I run into the same problem with the compilerTemplate method in @vue/ compiler-SFC. Currently compiling to TS using compilerTemplate, the next step was to compile ts to JS using TSC, but currently encountered a type error (in fact it seems to be a bug) and cannot proceed.

image

Is there a solution on the official website? Or do you need to handle the type problem manually if you want to use the correct type definition?

What is expected?

The correct type definition can also be obtained when the VUE file slot type is compiled to a numeric type .

What is actually happening?

Typescript type error when vue file slot type is compiled to numeric type

image

System Info

No response

Any additional comments?

No response