fix download name

This commit is contained in:
Theluyuan 2023-05-05 09:54:52 +08:00
parent f2249478ed
commit 27f75e2ced
4 changed files with 11 additions and 7 deletions

View File

@ -950,7 +950,8 @@ const _sfc_main = defineComponent({
getCheckboxProps: { type: Function, default: () => {
} },
getRadioProps: { type: Function, default: () => {
} }
} },
download: { default: "" }
},
emits: [
"change",
@ -1185,7 +1186,7 @@ const _sfc_main = defineComponent({
</html>`;
let a = document.createElement("a");
a.href = uri + base64(exportTemplate);
a.download = "\u4E0B\u8F7D\u6587\u4EF6.xls";
a.download = (props.download || "\u4E0B\u8F7D\u6587\u4EF6") + ".xls";
a.click();
return;
};

View File

@ -19374,7 +19374,8 @@ const _sfc_main$D = defineComponent({
getCheckboxProps: { type: Function, default: () => {
} },
getRadioProps: { type: Function, default: () => {
} }
} },
download: { default: "" }
},
emits: [
"change",
@ -19609,7 +19610,7 @@ const _sfc_main$D = defineComponent({
</html>`;
let a = document.createElement("a");
a.href = uri + base64(exportTemplate);
a.download = "\u4E0B\u8F7D\u6587\u4EF6.xls";
a.download = (props.download || "\u4E0B\u8F7D\u6587\u4EF6") + ".xls";
a.click();
return;
};

View File

@ -52,6 +52,7 @@ export interface TableProps {
loading?: boolean;
getCheckboxProps?: Function;
getRadioProps?: Function;
download?:string;
}
const props = withDefaults(defineProps<TableProps>(), {
@ -76,6 +77,7 @@ const props = withDefaults(defineProps<TableProps>(), {
loading: false,
getCheckboxProps: () => {},
getRadioProps: () => {},
download:""
});
const emit = defineEmits([
@ -423,7 +425,7 @@ const exportData = () => {
</html>`;
let a = document.createElement("a")
a.href = uri + base64(exportTemplate);
a.download="下载文件.xls";
a.download= (props.download || "下载文件") + ".xls";
a.click();
// window.location.href =
return;

File diff suppressed because one or more lines are too long