title: Vue generate and download excel file
body: <p>Is there any way i can generate an <strong>excel</strong> file programmatically using an array, and then allow the user to download it on an event fired?</p>
  <p>I have seen this done in javascript by creating a href tag with the download attr programmatically, but this isn't usually the approach of vue.</p>
  <p><em>Template</em></p>
  <pre class="lang-html prettyprint-override"><code>&lt;template&gt;
    &lt;button @click=&quot;toExcel&quot;&gt;Download&lt;/button&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  data(){
    return{
      someArray: [1,2,3]
    }
  },
  
  methods: {
    toExcel() {
      //code to export excel
    }
  }
  &lt;/script&gt;
  </code></pre>