Commit de48db808265433bdedf19a400a5012fe79a462f

Authored by Aresn
Committed by GitHub
2 parents 3073a5ce c1f0fc86

Merge pull request #4664 from musicnazi/2.0

树控件增加一个方法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]);
... ...