function Blob1() {
const onClick = () => {
//文件里的东西
var aFileParts = ['<a>123456789</a>']
//下载文件的格式
var oMyBlob = new Blob(aFileParts,{ type: "text/html"})
//路径
const url = window.URL.createObjectURL(oMyBlob)
//创建节点及各种属性
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.download = '大华'
document.body.appendChild(link)
link.click()
}
return (
<div>
<button onClick={onClick}>点我下载</button>
</div>
)
}