html:
控制按钮:
<el-button
type="success"
size="small"
:icon="active?'el-icon-arrow-up':'el-icon-arrow-down'"
@click="displaysubBond"
>展开</el-button>
主表+子表
<el-table :data="bondList" height="550" style="width:90%" :default-expand-all="isExpand" border>
<el-table-column type="expand">
//可展开的子表
<template slot-scope="props">
<el-table :data="subBondList" border >
<el-table-column></el-table-column>
……
</el-table>
</template>
</el-table-column>
<el-table-column></el-table-column>
</el-table>
script:
data(){
return {
isExpand:false
}
}
displaySubBond() {
this.active = !this.active;
if (this.active) {
console.log("展开");
this.isExpand = true;
} else {
console.log("关闭");
this.isExpand = false;
}
}
展开跟关闭都能显示到控制台上,但是子表就是不能展开,没有反应!
QAQ求解