[Vuejs]-Passing scoped slots through multiple components

0👍

There is 2 missing bit in your configuration.

Expose you item in the List.vue:

<span>
   <div v-for="item in items" :key="item.id">
   <slot :item="item"></slot>
</div>

Then you need to bind the name in your SearchAndList.vue.

So try:

<div class="clients-list">
<div class="table-responsive">
  <table class="table table-striped table-hover">
    <list-items :items="items">
        <slot scope-slot="{ item }" :name="item.name"></slot>
    </list-items>
  </table>
</div>

Leave a comment