jecovier/vue-json-excel

[Issue] Why can't the fields prop work properly?

G-H-Li opened this issue · 2 comments

I transfer a normal object to fields, like this:

exportFileds:{
    站点: 'stationId',
    日期: 'time',
    入库流量: 'inFlow',
    平滑入库流量: 'smoothInFlow',
    出库流量: 'outFlow',
    平滑出库流量: 'smoothOutFlow',
    水位: 'waterLevel',
    库容: 'capacity'
}

I use vue-json-excel like this:

<download-excel
              :fileds="exportFields"
              :data="tableData"
              :before-finish="finishExport"
              :name="tableTitle"
              type="xls">
              <el-button
                size="small"
                type="primary">导出</el-button>
</download-excel>

However, the exported file is not to my liking.
image

I'd appreciate it if you could solve my problem!

console.log(this.exportFields) // you might see undefined

@G-H-Li you set the property name wrong 😄

:fileds="exportFields"

fileds, should be fields