You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
394 B
15 lines
394 B
8 months ago
|
function downPdf(val) {
|
||
|
fetch(val).then(respose => {
|
||
|
return respose.blob()
|
||
|
}).then(blob => {
|
||
|
console.log(val);
|
||
|
const url = URL.createObjectURL(blob)
|
||
|
const a = document.createElement("a")
|
||
|
const name = val.substr(val.lastIndexOf('/') + 1, val.length)
|
||
|
a.href = url
|
||
|
a.download = name
|
||
|
a.click()
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export default downPdf
|