fix filename not applying
This commit is contained in:
parent
14fdd34964
commit
1a38e0273e
2 changed files with 3 additions and 2 deletions
|
|
@ -16,7 +16,8 @@ export const newExporter = ({
|
|||
|
||||
// Create an invisible link with a data url and simulate a click
|
||||
const e = document.createElement('a')
|
||||
e.setAttribute('download', `${filename}.${extension}`)
|
||||
const realFilename = typeof filename === 'function' ? filename() : filename
|
||||
e.setAttribute('download', `${realFilename}.${extension}`)
|
||||
e.setAttribute('href', `data:${mime};base64, ${window.btoa(stringified)}`)
|
||||
e.style.display = 'none'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue