Vue exports the contents of el-table

problem description

Export the data of el-table to Excel,. At present, table has 500 rows of data, paged display, 10 lines per page, a total of 50 pages

the environmental background of the problems and what methods you have tried

I have tried two methods. The first method can export the current data, that is, only 10 items can be exported, but it requires that all 500 pieces of data be exported at once.
the second method directly reports an error. The first method CSDN says that npm installs two, and the second method npm install three. Is there a feasible way to export all the data of el-table at one time

?.

related codes

/ / Please paste the code text below (do not replace the code with pictures)
/ / let wb = XLSX.utils.table_to_book (document.querySelector ("- sharptableXlsx"))

  // let wbout = XLSX.write(wb, { bookType: "xlsx", bookSST: true, type: "array" })
  // try {
  //   FileSaver.saveAs(new Blob([wbout], { type: "application/octet-stream" }), "sheetjs.xlsx")
  // } catch (e) { if (typeof console !== "undefined") console.log(e, wbout) }
  // return wbout
  // 
  require.ensure([], () => { //  webpack Code Splitting xlsl
    const { export_json_to_excel } = require("../../vendor/Export2Excel");
    // const tHeader = ["", "", "", "", ""]; // excel 
    const tHeader = ["ID", ""]; // excel 
    // const filterVal = ["id", "title", "author", "pageviews", "display_time"];
    const filterVal = ["stackHash", "stack"];
    // const list = this.list;
    const list = this.tableData;
    const data = this.formatJson(filterVal, list); //  array
    export_json_to_excel(tHeader, data, "excel");
  })

what result do you expect? What is the error message actually seen?

Feb.09,2022
Menu