1,有时候高亮当前选中的节点的不起作用 current-node-key属性既支持数字,也支持字符串,这个数据类型要和数据里面的id的数据类型对应起来,也就是说如果数据里面的id的数据类型是数字,那current-node-key属性就要设置成数字类型,反之一样 另外也要设置highlight-current属性,高亮当前选中的节点 2,获取不到当前选中的节...
需要设置node-key,ref,current-node-key 且写在nextTick里(必须等待dom渲染完毕后再执行) 重点设置setCurrentKey,否则样式不会高亮 传的值就是current-node-key绑定的值 image.png <el-treeref="treeRef":highlight-current="true":expand-on-click-node="false":data="departmentList":props="defaultProps"node...
deleteItem(data){consttreeNode=this.$refs.tree.getNode(data)treeNode.parent.loaded=falsetreeNode.parent.loadData()// 刷新父节点数据} 问题四:选中节点设置: setCurrentKey不起作用的问题处理 在新增、删除操作成功之后,我们常常需要重新设置当前选中的节点,el官方给我们提供了方法setCurrentKey,但初次使用这个...
</el-input> <el-tree class="filter-tree" :data="datatree" :props="defaultProps" default-expand-all highlight-current :filter-node-method="filterNode" @node-click="handleXmxz" ref="tree3"> </el-tree> </el-popover> handleXmxz:function(obj, node, data){ if(node.data.type!=0&&...
二、el-select 中 multiple多选,回显数据后编辑不起作用 三、el-dialog 样式修改 四、el-select + el-tree 五、el-tree 数据过滤 六、el-cascader 实现省市区动态联动 七、element 解决 el-table 表格错位问题 八、element 源码更改 九、补充 一、el-date-picker 限制过去日期无法选择 ...
<el-tree:data="cdList":props="{ label: 'name', children: 'children' }"node-key="id"ref="cdListTree":filter-node-method="filterNodeTree"@current-change="currentHandle"> </el-tree> <template> <el-input slot="reference" v-model="dataForm.parentName"@input="filterInput"placeholder="设...
check-on-click-node 添加之后无法实现点击节点选中。 element-botadded theinvalidlabelJul 6, 2018 element-botclosed this ascompletedJul 6, 2018 Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
const handleClick = (node)=>{ console.log(node) } WhenhandleClickis a public method, not just triggered bynode-click, I can't getnodein this way, I can only callgetCurrentNodeexternally and passhandleClick. Is this a very unfriendly approach.el-tree, on the other hand, usesgetCurrent...
想实现单选只需要给node增加点击事件,并控制setCheckedKeys即可: <el-tree :data="treeData"show-checkbox node-key="offerSvcCode"ref="tree"check-strictly highlight-current@check-change="handleClick" :props="defaultProps"></el-tree> 1 2 3