mirror of https://github.com/jeecgboot/jeecg-boot
🐛 添加Navigator上的msSaveBlob类型声明,修复api.ts中的eslint报错
parent
4be0f376cb
commit
b064d3e61f
|
@ -112,8 +112,8 @@ export const downloadFile = (url, fileName?, parameter?) => {
|
||||||
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
||||||
window.navigator.msSaveBlob(new Blob([data]), fileName);
|
window.navigator.msSaveBlob(new Blob([data]), fileName);
|
||||||
} else {
|
} else {
|
||||||
let url = window.URL.createObjectURL(new Blob([data]));
|
const url = window.URL.createObjectURL(new Blob([data]));
|
||||||
let link = document.createElement('a');
|
const link = document.createElement('a');
|
||||||
link.style.display = 'none';
|
link.style.display = 'none';
|
||||||
link.href = url;
|
link.href = url;
|
||||||
link.setAttribute('download', fileName);
|
link.setAttribute('download', fileName);
|
||||||
|
|
|
@ -80,6 +80,11 @@ declare global {
|
||||||
[elem: string]: any;
|
[elem: string]: any;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface Navigator {
|
||||||
|
// fix:msSaveBlob dose exist on type Navigator
|
||||||
|
msSaveBlob?: (blob: any, defaultName?: string) => boolean;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'vue' {
|
declare module 'vue' {
|
||||||
|
|
Loading…
Reference in New Issue