Scoped Slots in Vue 3

How to write this with v-slot?

    v-for="(slot, key) in $scopedSlots"
    <slot :name="key" v-bind="scope" />

Hello @Kaylle
Hope you are very well.
I’m provide some link, you can use this:-

Thank you

I tried this but it doesn’t working (

<template v-for="(slot, key) in $scopedSlots">
    <slot v-bind:slot="slot" />

This how I do it without v-for

<template v-slot:body="scope">
    <slot name="body" v-bind="scope" />

But how I include v-for there?

Can you give us a replication of what you’re trying to loop through.

Something like this is how you’d normally loop a slot, but your use case is a bit different.

  <li v-for="item in items">
    <slot name="item" v-bind="item"></slot>

You could also consider using a render function instead so you have more power over the slots.

I’m trying to pass slot to child of child component

I have component “Client.vue”

<TableComponent >
      <template v-slot:body="props">
          Some data for 'body' slot
      <template v-slot:item="props">
          Some data for 'item' slot
</TableComponent >

I have component “TableComponent.vue” where I want to use loop

    <template v-slot:body="scope" >
        <slot name="body" v-bind="scope" />
    <template v-slot:item="scope" >
        <slot name="item" v-bind="scope" />

I found it

<template v-for="(_, name) in $slots" v-slot:[name]="slotData">
    <slot :name="name" v-bind="slotData" />

Thanks anyway)