<!-- table部分 -->文章来源:https://www.toymoban.com/news/detail-804609.html
<el-table ref="table" :data="tableData" style="margin-top: 20px" row-key="ID" default-expand-all :tree-props="{children: 'children', hasChildren: 'hasChildren'}" :row-class-name="rowClassNameFun" @select="select" @select-all="selectAll"> <el-table-column type="selection" width="50"></el-table-column>// JS部分文章来源地址https://www.toymoban.com/news/detail-804609.html
// 初始化数据,将数据都用isSelect标记一下,isSelect为false不选中、true选中、half半选 添加子集的父级ID initData (data) { data.forEach((item) => { item.isSelect = false // 默认为不选中 if (item.children && item.children.length > 0) {
到了这里,关于elementui table树形多选、半选、全选解决方案的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!