-
-
Notifications
You must be signed in to change notification settings - Fork 443
Incorrect type inference when you define slot element in v-for loop #3787
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
Comments
It looks like the issue is because of |
Hmm, yeah. Looks like it is. I found an issue in the TS repo related to this behavior, but looks like it can be fixed by using generics. You can find more info in this PR. And I fixed my repro according to the suggested solution in the TS PR. You can see my fix here I'm just thinking about can it be fixed directly in the Vetur, or should it be applied in the user's code? |
Assuming thatline 33 in the reproduction link has a missing
Then the problem is identical to this code. Thus I think this is a TS limitation. We can't fix this on Vue's side. |
Uh oh!
There was an error while loading. Please reload this page.
I'm trying to implement a table with dynamic slot names that are based on the column names, but I am faced with an issue with types in the
v-for
loop inside the template. For some reason the result type of the value is inferred asnever
, but if we do the same in the typescript we get a different type. Looks like it's an issue in the template type inferring.Link to repro
The text was updated successfully, but these errors were encountered: