Commit c1f0fc86e2beb04e6d2689a5f61c5d896591b2a9
1 parent
3073a5ce
树控件增加一个方法getCheckedAndIndeterminateNodes可以获取到选中和不完全选中状态的节点组合
Showing
1 changed file
with
4 additions
and
0 deletions
Show diff stats
src/components/tree/tree.vue
... | ... | @@ -141,6 +141,10 @@ |
141 | 141 | /* public API */ |
142 | 142 | return this.flatState.filter(obj => obj.node.checked).map(obj => obj.node); |
143 | 143 | }, |
144 | + getCheckedAndIndeterminateNodes () { | |
145 | + /* public API */ | |
146 | + return this.flatState.filter(obj => (obj.node.checked || obj.node.indeterminate)).map(obj => obj.node); | |
147 | + }, | |
144 | 148 | updateTreeDown(node, changes = {}) { |
145 | 149 | for (let key in changes) { |
146 | 150 | this.$set(node, key, changes[key]); | ... | ... |