mercredi 26 juin 2019

Vue js Image force download not working by using anchor tag

I am using Laravel with vue js. I need to download an image forcefully on browser but its now working for me.

var link = document.createElement('a');
link.href = 'image/ab.jpg';
link.download = 'Download.jpg';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);   

This is working for simple javascript but for vue js, its not working. Its simply opening image url in browser.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire