elmentUI el-table动态表头问题?

1673342222249.png

表头是动态并且表头需要加全选框,这种需要怎么做呢,用循环el-table-column只是表头是动态的,没有办法加选择框,动态表头数据是从单独接口拿的数据。

阅读 1.3k
1 个回答

你这个属于定制化了, 需要用ELement提供的定制表头功能, 自己写checkBox, 自己写全选和取消全选的逻辑

<el-table-column
  align="right">
  <template slot="header" slot-scope="scope">
    <el-checkbox v-model="scope.row.xxx">{{scope.row.xxx}}</el-checkbox>
  </template>
  <template slot-scope="scope">
    <el-checkbox v-model="scope.row.xxx">{{scope.row.xxx}}</el-checkbox>
  </template>
</el-table-column>
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题