文件自动下载文件
let fileName = 'download.txt'; let fileContent = 'helloWorld'; let a = document.createElement('a'); a.download = fileName; a.href = window.URL.createObjectURL(new Blob([fileContent])); a.click();
具体的总结下载可以看看这篇 很详细 https://segmentfault.com/a/1190000023731567?utm_source=sf-related
点赞👍+关注我吧~
我只想成为更好的自己