title: Iterating slot content for iterated slots in child component in Vue.js
body: <p>I've got a child component (that I cannot edit) where each row in an object is rendered inside a div with a specific slot, and I'd need to pass data from the parent for each of those elements. I'm trying to iterate through every element of the object in the parent component, generate a slot and pass the desired code to the child, but unfortunately I can't manage to and I can't find any material to support me.</p>
  <p>The child component:</p>
  <pre><code>&lt;div class=&quot;slotchildren&quot; v-for=&quot;(child, childindex) in row.elementChildren&quot; :key=&quot;childindex&quot;&gt;
  
    &lt;span&gt;element nr. {{child.id}}&lt;/span&gt;
    &lt;slot :name=&quot;`element-child-${row[idlabel]}-${childindex}`&quot; :row=&quot;child&quot;&gt;
      ...
    &lt;/slot&gt;
  &lt;/div&gt;
  </code></pre>
  <p>The parent component (not working):</p>
  <pre><code>&lt;template v-for=&quot;row in rows&quot;&gt; --&gt;
    &lt;template  v-slot:`element-row-${row.id}`=&quot;{row}&quot;&gt;
          
          //--&gt; [vue/valid-v-slot] 'v-slot' directive doesn't support any modifier
          //--&gt; [vue/valid-v-slot] 'v-slot' directive must be owned by a custom element, but 'template' is not.
  
      &lt;span&gt;{{row.name}}&lt;/span&gt;
  
    &lt;/template&gt;
  &lt;/template&gt;
  </code></pre>
  <p>Is something like this feasible and how? If it's not, what could be a viable workaround, consideind that I can't edit the child component?</p>
  <p>Thanks in advance.</p>