Vue
Download a file
: function() {
saveFileconst data = JSON.stringify(this.myData)
const blob = new Blob([data], {type: 'text/plain'})
const e = document.createEvent('MouseEvents'),
= document.createElement('a');
a .download = "myData.json";
a.href = window.URL.createObjectURL(blob);
a.dataset.downloadurl = ['text/json', a.download, a.href].join(':');
a.initEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
e.dispatchEvent(e);
a }