fix download name

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

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;