title: vuejs - pass scope templates down multiple child-levels
body: <p>I'm building a table with vue, and I use slots for customized formatting. F.e. the table (which is a component), uses a <code>thead</code>-component, where each <code>th</code> is a scoped/named-slot. Specifing a template for the slot only works from parent to child though (or so it seems - <code>vm.$scopedSlots</code> is empty for the <code>thead</code>-component). </p>
  
  <p>This is the outline of what it looks like:</p>
  
  <pre><code>// in index.html
  &lt;my-table :data="data"&gt;
    &lt;template name="col1-header" props="column"&gt;
      &lt;th style="colour: blue;"&gt;{{ column.name }}&lt;/th&gt;
    &lt;/template&gt;
  &lt;/my-table
  
  // in my-table component
  &lt;template&gt;
    &lt;table&gt;
      &lt;my-thead :columns="columns"&gt;
      &lt;/my-thead&gt;
      // tr: v-for over data
    &lt;/table&gt;
  &lt;/template&gt;
  
  // in my-thead component
  &lt;template&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;slot :name="column.name + '-header'" :item="column" v-for="column in columns"&gt;
          &lt;th&gt;{{ column.name }}&lt;/th&gt;
        &lt;/slot&gt;
      &lt;/tr&gt;
    &lt;/thead
  &lt;/template&gt;
  </code></pre>
  
  <p>Using the <code>template</code> has no use, since it only seems to apply to <code>my-table</code> rather than <code>my-thead</code>. The only way to use the <code>slot</code>s defined in <code>my-thead</code> is if I add templates in the <code>my-table</code>-component, but I need to specify them outside of the component. </p>
  
  <p>Is there a way to pass the template that gets specified when using <code>my-table</code> to the <code>my-thead</code> component? As I already mentioned, I tried using <code>vm.$scopedSlots</code>, but this property is read-only and can't be set on the <code>my-thead</code> component. I can access the <code>$scopedSlots</code> of the parent <code>vm</code> though. I also tried using <code>slot</code> and <code>template</code> in the <code>my-table</code>-component to somehow pass on the template to the child, but that didn't work either.</p>