elementUI tree组件获取当前选择所有选中(check)和半选中(indeterminate)的节点
this.$refs.tree.getCheckedKeys().concat(this.$refs.tree.getHalfCheckedKeys())
elementUI tree组件获取当前选择所有选中(check)和半选中(indeterminate)的节点
网上查了半天,一大堆都说要改源码的,最后发现有方法不用改源码的
获取方法如下
this.$refs.tree.getCheckedKeys().concat(this.$refs.tree.getHalfCheckedKeys())
将getCheckedKeys()和getHalfCheckedKeys()两个方法获取的数据合并就是我们想要的数据了
![](https://img2022.cnblogs.com/blog/1192734/202204/1192734-20220414220158622-572731489.png)
elementUI tree组件获取当前选择所有选中(check)和半选中(indeterminate)的节点_IT