{ | ||
"name": "js2excel", | ||
"version": "0.7.8", | ||
"version": "0.7.9", | ||
"author": "pomysky@gmail.com", | ||
@@ -5,0 +5,0 @@ "description": "A simple module for excel and json converts each other", |
@@ -36,32 +36,5 @@ ## js2excel | ||
/** | ||
* excel's data | ||
**/ | ||
// excel's columns's header | ||
let headers = [ | ||
// excel's data will be exports, which you probably get it from server. | ||
let data = [ | ||
{ | ||
// the name will be as the excel column name | ||
name: 'User Id', | ||
// the prop will be as the excel row data, which is the rows' item's property. | ||
prop: 'userId' | ||
}, | ||
{ | ||
name: 'Phone Number', | ||
prop: 'userPhoneNumber' | ||
}, | ||
{ | ||
name: 'User Address', | ||
prop: 'userAddress' | ||
}, | ||
{ | ||
name: 'Date', | ||
prop: 'date' | ||
} | ||
]; | ||
// excel rows' data | ||
// rows' data will be exports, which you probably get it from server. | ||
let rows = [ | ||
{ | ||
"userId": 1, | ||
@@ -90,3 +63,3 @@ "userPhoneNumber": 1888888888, | ||
json2excel({ | ||
headers, rows, | ||
data | ||
name: 'user-info-data', | ||
@@ -102,4 +75,4 @@ formateDate: 'yyyy/mm/dd' | ||
json2excel({ | ||
headers, rows, | ||
name: 'user-info-data', | ||
data | ||
name: 'test', | ||
formateDate: 'dd/mm/yyyy' | ||
@@ -113,3 +86,3 @@ }); | ||
 | ||
 | ||
@@ -157,12 +130,4 @@ ### Convert excel to json | ||
`opts.headers` | ||
`opts.data` | ||
Type: `Array` | ||
Default: [] | ||
Excel's column's headers. | ||
`opts.rows` | ||
Type: `Array`, | ||
@@ -172,3 +137,3 @@ | ||
Excel's rows's data. | ||
Excel's data. | ||
@@ -175,0 +140,0 @@ `opts.name` |
export interface Params { | ||
headers: any[]; | ||
rows: any[]; | ||
data: any[]; | ||
name?: string; | ||
@@ -5,0 +4,0 @@ formateDate?: string; |
Sorry, the diff of this file is too big to display
907134
-0.12%3522
-0.09%194
-15.28%