title: Vue : how to download a file to browser using the download tag
body: <p>I'm using axios and want to download a PDF and an image file.</p>
  
  <p>I can download both and open the image, but, when I try to open the PDF file, it doesn't open.</p>
  
  <pre><code>downloadItem({ url, name }) {
        axios
          .get(url, { responseType: 'blob' })
          .then((response) =&gt; {
            const blob = new Blob([response.data], { type: response.data.type });
            const link = document.createElement('a');
            link.href = URL.createObjectURL(blob);
            link.download = name;
            link.click();
            URL.revokeObjectURL(link.href);
          })
          .catch(console.error);
      },
  </code></pre>
  
  <p>Can anybody help me ? Sorry for my English.</p>