<el-table
:data="tableData"
class="table-childer"
style="width: 100%; margin-bottom: 20px"
row-key="id"
border
lazy
:load="load"
@cell-click="handleClick"
:tree-props="{ children: 'children', hasChildren: 'isLeaf' }"
>
**重点**
@cell-click="handleClick"
// 判断列名称,点击某一列单元格时暂开树
const handleClick = (row,column,cell,event) => {
if(column.label==='组织架构名称') {
if(event.currentTarget.querySelector(".el-table__expand-icon")) {
event.currentTarget.querySelector(".el-table__expand-icon").click()
}
}
}
element-plus树形数据与懒加载 点击下拉图标旁边的文字展开树形结构
最新推荐文章于 2024-05-11 11:49:12 发布