var data = ["1,2,3\n","4,5,6"] // 每一行数据为一个字符串,字符串用“,”隔开,并且在每一行加上换行符
var blob = new Blob(data, {type:"text/csv,charset=UTF-8"})
var csvUrl = URL.createObjectURL(blob)
var aEle = document.createElement("a")
aEle.download = "data.csv" //文件名随意
aEle.href = csvUrl
aEle.click()