el-table嵌套el-table问题?

el-table使用el-table-column type="expand"嵌套el-table,但是嵌套的table是单独请求数据的并且每个嵌套的table都需要单独加一个分页,请问这种该怎么处理?

阅读 1.8k
1 个回答

获取总数据源:this.tableData=this.tableData.map(item=>{

item.expand=[],
item.page={
    currenetPage:1,
    pageSize:20
}
item.isExpand=false
return item

})
列表dom
<el-table @expand-change="expandChange">

方法
expandChange(row){
if(!row.isExpand改成true,关闭时判断时true不请求接口同时改成false){

请求接口同时把row.isExpand改成true,关闭时判断时true不请求接口同时改成false

}

}

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题