Skip to content
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

language-plugin-pug unused prop with v-slot and v-for #4335

Closed
psevertson opened this issue May 2, 2024 · 0 comments · Fixed by #4626
Closed

language-plugin-pug unused prop with v-slot and v-for #4335

psevertson opened this issue May 2, 2024 · 0 comments · Fixed by #4626
Assignees
Labels
bug Something isn't working

Comments

@psevertson
Copy link

We are encountering the following issue when using Pug, with v-slot and v-for.
The goal was to take all slots passed into our wrapper component, and pass them down into a child component. To do this, we use v-for with $slots and create a v-slot for each of them, where the content is a slot of the same name.
The ts-plugin gives us the following error: 'mySlot' is declared but its value is never read

template(v-slot:[mySlot]="slotProps" v-for="(_, mySlot) in $slots" :key="mySlot")
			slot(:name="mySlot" v-bind="slotProps")
image

We have also tried with a less complex example, and it appears the issue always occurs when a template has both a v-slot and a v-for on it.
image


We have noticed that this does not occur when using HTML, only Pug. Here is the HTML equivalent:

<template v-slot[mySlot]="slotProps" v-for="(_, mySlot) in $slots" :key="mySlot">
    <slot :name="mySlot" v-bind="slotProps"></slot>
</template>
@KermanX KermanX added the bug Something isn't working label Jul 30, 2024
@KermanX KermanX self-assigned this Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants