title: How to create Vue.js slot programmatically?
body: <p>I have the following component with a slot:</p>
  
  <pre><code>&lt;template&gt;
      &lt;div&gt;
          &lt;h2&gt;{{ someProp }}&lt;/h2&gt;
          &lt;slot&gt;&lt;/slot&gt;
      &lt;/div&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>For some reasons, I have to manually instantiate this component. This is how I am doing it:</p>
  
  <pre><code>const Constr = Vue.extend(MyComponent);
  const instance = new Constr({
      propsData: { someProp: 'My Heading' }
  }).$mount(body);
  </code></pre>
  
  <p><strong>The problem is: I am not able to create slot contents programmatically.</strong> So far, I can create simple string based slot:</p>
  
  <pre><code>const Constr = Vue.extend(MyComponent);
  const instance = new Constr({
      propsData: { someProp: 'My Heading' }
  });
  
  // Creating simple slot
  instance.$slots.default = ['Hello'];
  
  instance.$mount(body);
  </code></pre>
  
  <p><strong>The question is - how can I create <code>$slots</code> programmatically and pass it to the instance I am creating using <code>new</code>?</strong></p>
  
  <p><em>Note: I am not using a full build of Vue.js (runtime only). So I don't have a Vue.js compiler available to compile the template on the fly.</em></p>