第一种:用expand属性
<easy-custom-table rowKey="id" :expand="expand" //添加expand属性,属性值为一个对象 :tableData="tableData" :columns="columns" :maxHeight="tableHeight" :headerCellStyle="{ background: '#e7ecf6' }" ></easy-custom-table>
在data中配置expand,expand属性的配置为render函数
expand: { render: (h, params) => { return ( <easy-custom-table border={true} tableData={params.row.rawMaterialTraceChildren} columns={this.childTitles} headerCellStyle={{ background: '#f5f7fa' }} ></easy-custom-table> ) } },
第二种:利用columns配置expand
<easy-custom-table rowKey="id" :tableData="tableData" :columns="columns" //在columns中配置展开行 :maxHeight="tableHeight" @search="pageChange" :headerCellStyle="{ background: '#e7ecf6' }" ></easy-custom-table>
{ label: '', type: 'expand', render: (h, params) => { return ( <easy-custom-table border={true} tableData={params.row.rawMaterialTraceChildren} columns={this.childTitles} headerCellStyle={{ background: '#f5f7fa' }} ></easy-custom-table> ) } },
添加一行type为expand,也用render函数渲染
标签:render,配置,用法,ui,easy,params,type,expand From: https://www.cnblogs.com/zengyu123/p/17579298.html