Skip to content

lapDog/JsonExportExcel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

JsonExportExcel

####使用方法

1.引入js

<script src="js/xlsx.full.min.js"></script>
<script type="text/javascript" src="js/jsonToExcel.min.js"></script>

2.js代码

var option={};   

option.data=[{a:1,b:2},{a:2,b:3}];   

var toExcel=new ExportJsonExcel(option);   

toExcel.saveExcel();

option

  • data 数据源
<!--两种形式-->
<!--第一种 object-->
[{one:11,two:12},{one:21,two:22}]
<!--第二种 arrary-->
[[11,12],[21,22]];

效果

Paste_Image.png

  • filter 列过滤(只有在data为object下起作用)
option.filter=['two','one'];

效果:

Paste_Image.png

  • fileName 下载文件名(默认:download)

Releases

No releases published

Packages

No packages published