<el-table :data="tableData" border @expand-change="expandChange" :row-key="rowKey" :expand-row-keys="expandRowKeys">
<el-table-column type="expand">
<template slot-scope="props">
<div>{{props.expandList}}</div>
</template>
</el-table-column>
</el-table>
data() {
return {
expandRowKeys:[],
tableData: []
}
},
methods: {
// 全部隐藏
hanghide () {
this.expandRowKeys = []
},
rowKey(row) {
return row.id
},
expandChange(value, expandedRows) {
request({}).then(res=> {
this.$set(this.tableData[value.index],'expandList',res.data)
this.formatData(this.tableData[value.index].expandList,value.type);
}).catch(()=> {})
this.expandRowKeys=expandedRows.map(item => item.orderNum);
},
}
02-17
4983
09-27
5411
03-31
1603
11-18