Commit 6da6fffa1d9a020bf098fad1c2681220c96af995
Committed by
GitHub
Merge pull request #1444 from liuyanshi/allow_use_Blob_download_csv
allow browser whose useragent contains Safari to use Blob for downloading csv
Showing
1 changed file
with
1 additions
and
2 deletions
Show diff stats
src/components/table/export-csv.js
... | ... | @@ -41,7 +41,7 @@ const csv = { |
41 | 41 | _getDownloadUrl (text) { |
42 | 42 | const BOM = '\uFEFF'; |
43 | 43 | // Add BOM to text for open in excel correctly |
44 | - if (window.Blob && window.URL && window.URL.createObjectURL && !has('Safari')) { | |
44 | + if (window.Blob && window.URL && window.URL.createObjectURL) { | |
45 | 45 | const csvData = new Blob([BOM + text], { type: 'text/csv' }); |
46 | 46 | return URL.createObjectURL(csvData); |
47 | 47 | } else { |
... | ... | @@ -66,7 +66,6 @@ const csv = { |
66 | 66 | const link = document.createElement('a'); |
67 | 67 | link.download = filename; |
68 | 68 | link.href = this._getDownloadUrl(text); |
69 | - link.target = '_blank'; | |
70 | 69 | document.body.appendChild(link); |
71 | 70 | link.click(); |
72 | 71 | document.body.removeChild(link); | ... | ... |