部分代码
<el-table
style="margin:10px?0;border:1px?solid?#eee;width:100%;"
ref="refTable"
v-loading="listLoading"
:data="tableData"
:max-height="maxTableHeight"
@selection-change="selectionChange"
@expand-change="expandChange"
>
<el-table-column type="expand">
<template slot-scope="scope">
<el-table
:data="scope.row.child"
border
style="width:?100%"
@selection-change="(selection)=>selectionSubChange(selection,scope.$index)"
:ref="`subTable${scope.$index}`"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="payStageName" label="费用类型"></el-table-column>
<el-table-column prop="payRate" label="付款比例"></el-table-column>
<el-table-column prop="amount" label="计划结算金额"></el-table-column>
<el-table-column prop="date" label="结算周期"></el-table-column>
<el-table-column prop="name" label="计划结算时间"></el-table-column>
<el-table-column prop="incomeplanRate" label="回款比例"></el-table-column>
<el-table-column prop="createTime" label="完工验收时间"></el-table-column>
<el-table-column prop="stopTime" label="停留时长"></el-table-column>
<el-table-column prop="specialName" label="特殊审批"></el-table-column>
<el-table-column prop="settlementNo" label="结算单号"></el-table-column>
</el-table>
</template>
</el-table-column>
我在表格展开后执行内部勾选的代码,
expandChange(row, rows)?{
this.$nextTick(function()?{
//this.ceshiData为勾选外层表格selection数组
this.ceshiData.forEach((item, i) => {
if (item.id === row.id) {
//判断展开行的id是不是与外层勾选数组中相同,如果相同,就执行row.child,即内部表格循环
row.child.forEach((list, index) => {
this.$refs["subTable" + [i]].toggleRowSelection(list, true);
});
}
});
});
},
上面代码也已经触发了内部复选框的select-change方法,但是复选框就是不勾选,各种尝试都不行,不知道是哪里的问题, 烦劳有经验的人帮忙解答下,在此谢过了!!!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…