2、my configuration of table columns are following:
exportColumsOfRules: [
{
key: 'cityName',
title: 'cityName'
},
{
key: 'cityId',
title: 'cityId'
},
{
key: 'isTiming',
title: '是否设置分时'
},
{
key: 'timingSet',
title: '分时设置',
// type: 'expand',
render: (h, params) => {
return h('div', [
h('Table', {
props: {
columns: [
{ title: '分时价格', key: 'timingPrice' },
{ title: '两轮车|分时价格', key: 'twoWheelTimingPrice' },
{ title: '生效月份', key: 'months' },
{ title: '生效节假日', key: 'holidays' },
{ title: '生效天', key: 'timingType' },
{ title: '生效时间段', key: 'periods' }
],
data: params.row.timingSet
}
})
])
}
}
],
3、my tabular data of desciption is following: 'exportDatas' is an array of objects, that is, each item is an object, including 'cityName','cityId','isTiming' and timingSet. timingSet is an array of multiple objects, each containing five key-value pairs; Equivalent to exportDatas being an array object, an object with a key-value pair is also an array object.With the exception of timingSet, all of the key-value pairs have been formatted to fit the csv format.For example,all values are string,and separated by Chinese commas. 4、When I execute the 'exportData' function:
const exportData = () => {
this.$refs.table.exportCsv({
filename: '生效列表',
separator: ',',
columns: this.exportColums, //formatted
data: this.exportDatas. //formatted
})
}
`
the result is that the timingSet in nor rendered,but 'cityName','cityId','isTiming'are rendered.Besides,the head of 'timingSet' are not rendered!
index.md
1、my Parent table is following: ` <Table class="custom-table" :columns="exportColumsOfRules" :data="exportDatas" :loading="loading" border ref="table"