This commit is contained in:
Viet An
2026-05-14 09:11:18 +07:00
parent 336c8c9036
commit 4d37397ee4
25 changed files with 450 additions and 209 deletions

View File

@@ -403,7 +403,7 @@ export default defineNuxtPlugin(() => {
};
//======================Export===============================
const exportExcel = function (data, filename, fields) {
const exportExcel = async function (data, filename, fields) {
var _filename = filename + ".xlsx";
let list = [];
data.map((v) => {
@@ -414,8 +414,9 @@ export default defineNuxtPlugin(() => {
});
list.push(ele);
});
var XLSX = require("xlsx");
//workBook class
const XLSX = await import("xlsx");
// WorkBook class
function Workbook() {
if (!(this instanceof Workbook)) return new Workbook();
this.SheetNames = [];