树结构展开:事件 @expand-change='handledetail'
设置:type="expand"
<el-table :data="videoList.content" row-key="id" style="width: 100%;background-color: #000; " :show-header='false' @expand-change='handledetail'>
<el-table-column type="expand">
<template slot-scope="props">
<div style="background-color: #292b35;">
子页内容
</div>
</template>
</el-table-column>
<el-table-column>
主页内容
</el-table-column>
事件处理:
res.content = res.content.map((item, index) => {
item.keyId = index;
item.childrenData = []; // 添加子表格数据
return item;
});
获取子数据:其中有判断展开的事件
handled