title: Reference same template in two different places for rendering inside a Vue component
body: <p>I have this component:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;template&gt;
  
    &lt;div&gt;    
  
      &lt;!-- If usecard is true, I want to render a wrapper --&gt;
      &lt;v-card flat v-if=&quot;usecard&quot;&gt;
        &lt;v-container&gt;
  
          &lt;!-- I want to reference the errors template here --&gt;
  
        &lt;/v-container&gt;
      &lt;/v-card&gt;
  
      &lt;!-- If usecard is false, I want to render only the errors template --&gt;
      &lt;div v-if=&quot;!usecard&quot;&gt;
  
        &lt;!-- I want to reference the errors template here --&gt;
  
      &lt;/div&gt;
  
      &lt;!-- Template for error stuff --&gt;
      &lt;template id=&quot;errors&quot;&gt;
        &lt;v-layout row wrap v-if=&quot;errors.length&quot;&gt;
          &lt;v-flex xs12&gt;
            &lt;v-alert :value=&quot;true&quot; type=&quot;error&quot;&gt;
              &lt;ul&gt;
                &lt;li v-for=&quot;(error, i) in errors&quot; :key=&quot;i + error&quot;&gt;{{ error }}&lt;/li&gt;
              &lt;/ul&gt;
            &lt;/v-alert&gt;
          &lt;/v-flex&gt;
        &lt;/v-layout&gt;
      &lt;/template&gt;
  
    &lt;/div&gt;
  
  &lt;/template&gt;
  
  &lt;script&gt;
  export default {
    name: &quot;NuErrorList&quot;,
    props: {
      errors: {
        type: Array,
        required: false,
        default: () =&gt; [],
      },
      usecard: {
        type: Boolean,
        required: false,
        default: () =&gt; false,
      },
    },
    data() {
      return {};
    },
  };
  &lt;/script&gt;
  </code></pre>
  <p>Basically, I want to render a wrapper around a defined chunk of HTML without having to repeat it. I thought on defining a <code>template</code> and then referencing it in two different places that render alternatively depending on the value of the <code>usecard</code> prop. But I don't know how to reference that template from those two different places.</p>
  <p>Any ideas?</p>