import FileSaver from "file-saver";
import XLSX from "xlsx"; 换成import * as XLSX from 'xlsx'
downloadval() {
let vb = XLSX.utils.table_to_book(document.getElementById("outTable"));
let vbout = XLSX.write(vb, {
bookType: "xlsx",
bookSST: true,
type: "array",
});
try {
FileSaver.saveAs(
new Blob([vbout], { type: "application/octet-stream" }),
"所获荣誉.xlsx"
);
} catch (e) {
if (typeof console !== "undefined") console.log(e, vbout);
}
return vbout;
},
<el-table
:data="ruleForm.form"
style="width: 100%"
id="outTable"
v-show="false"
>