view-design / ViewUIPlus

An enterprise-level UI component library and front-end solution based on Vue.js 3
https://www.iviewui.com
Other
377 stars 131 forks source link

Table组件使用render函数渲染嵌套表格数据失败 #317

Open fieemiracle opened 1 year ago

fieemiracle commented 1 year ago

1、my Parent table is following: ` <Table class="custom-table" :columns="exportColumsOfRules" :data="exportDatas" :loading="loading" border ref="table"

<Button class="" type="primary" @click="exportData" style="width: 120px; height: 30px" :loading='exportLoading'

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