title: How to copy InnerHtml to clipboard in Vue.js?
body: <p>I'd like to copy the content of this for-loop into clipboard:</p>
  
  <pre><code>&lt;div ref="text" class="links"&gt;
          &lt;div class="row" v-for="(name, index) in resultNames" :key="index" &gt;                                    
              &lt;p&gt;{{makeUrl(name)}} &lt;/p&gt;
          &lt;/div&gt;   
  &lt;/div&gt;  
  &lt;button   @click="handleCopy"&gt;Copy to Clipboard&lt;/button&gt; 
  </code></pre>
  
  <p>I followed <a href="https://stackoverflow.com/a/45041489/517235">this</a> answer and came up with this method:</p>
  
  <pre><code>  handleCopy() {
       this.$refs.text.select();
       document.execCommand('copy');
      }
  </code></pre>
  
  <p>But this results in:</p>
  
  <pre><code>Uncaught TypeError: this.$refs.text.select is not a function
  </code></pre>
  
  <p>So I'm left clueless how can I solve this withouth using third party javascript plugins? </p>
  
  <p><strong>P.S.</strong> I tried some JS specific suggested answers, like <a href="https://stackoverflow.com/questions/1173194/select-all-div-text-with-single-mouse-click/1173319#1173319">this</a>, but get error:</p>
  
  <pre><code>Uncaught TypeError: Failed to execute 'selectNode' on 'Range': parameter 1 is not of type 'Node'.
  </code></pre>