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

Open
psevertson opened this issue May 2, 2024 · 0 comments
Open

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

psevertson opened this issue May 2, 2024 · 0 comments

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant