工艺
This commit is contained in:
@@ -11,6 +11,11 @@ const tableToExcel = (function() {
|
||||
return function(table, filename, sheetname) {
|
||||
if (!table.nodeType) table = document.getElementById(table)
|
||||
const ctx = { worksheet: sheetname || 'Worksheet', table: table.innerHTML }
|
||||
const blob = new Blob([format(template, ctx)])
|
||||
if ('msSaveOrOpenBlob' in navigator) {
|
||||
window.navigator.msSaveOrOpenBlob(blob, filename + '.xls')
|
||||
return
|
||||
}
|
||||
const aTag = document.createElement('a')
|
||||
aTag.href = uri + base64(format(template, ctx))
|
||||
aTag.download = filename
|
||||
|
||||
Reference in New Issue
Block a user