-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Description
I'm trying to make a custom list component using a scoped slot like the one in the docs, and I would like to expose all of the item properties as props to the template. Unfortunately, the v-bind="obj"
syntax doesn't seem to be working for me in a scoped slot. Is this deliberate?
Regular v-bind:prop="obj.prop"
syntax is working correctly, but it would be great if I could expose everything at once.
I don't believe I'm making a mistake, but sincere apologies if I am, or if this has been mentioned somewhere else that I missed.
Thank you!
Entry point:
<custom-list :items="listItems">
<template scope="item">
<li>{{ item }}</li>
</template>
</custom-list>
CustomList with implicit v-bind object binding:
<template>
<ul>
<slot v-for="item of items" v-bind="item"></slot>
</ul>
</template>
Result:
CustomList with explicit prop binding:
<template>
<ul>
<slot v-for="item of items" :id="item.id"></slot>
</ul>
</template>
Metadata
Metadata
Assignees
Labels
No labels