easy-xlsx
v1.0.9
Published
By passing columns, data, and Excel names, you can easily export the desired Excel table.
Downloads
2
Readme
easy-xlsx
By passing columns, data, and Excel names, you can easily export the desired Excel table.
//Table Title
const columns = [{
title:"Serial Number", // title: Rows used to display workbooks
dataIndex: "id",
key: "id",
},{
title:"name",
dataIndex: "name", // The final filtering of data is displayed with dataIndex as the key
key: "name", // The data can also be displayed as a key and needs to be changed in the source code according to the key
},{
title:"sex",
dataIndex: "sex",
key: "sex",
},{
title:"age",
dataIndex: "age",
key: "age",
},]
//Reshaping array data will retain the desired data through filtering
const data = [ {
id:1,
name:'Xiao Hong',
sex:'male',
age:20,
show:false,
},{
id:2,
name:'Xiao Huang',
sex:'female',
age:18,
show:false,
},{
id:3,
name:'Xiao Lan',
sex:'male',
age:18,
show:false,
},{
id:4,
name:'Xiao Lv',
sex:'male',
age:19,
show:true,
},{
id:5,
name:'Xiao Bai',
sex:'female',
age:18,
show:true,
},{
id:7,
name:'Xiao Hei',
sex:'male',
age:18,
show:false,
},{
id:8,
name:'Xiao Zi',
sex:'female',
age:123,
show:true,
},{
id:9,
name:'Xiao Wang',
sex:'male',
age:21,
show:false,
},{
id:10,
name:'Xiao Yu',
sex:'male',
age:20,
show:true,
},]
//表格名称
const excelName = "Demo Excel Table"
// import Excel from "easy-xlsx"
// Excel(columns, data, excelName)