Tree: add filter-node-method prop & filter method.

This commit is contained in:
Furybean
2016-11-22 00:08:22 +08:00
committed by 杨奕
parent 2c764d13fa
commit 59293a219e
7 changed files with 65 additions and 3 deletions

View File

@@ -57,7 +57,8 @@
default: false
},
highlightCurrent: Boolean,
load: Function
load: Function,
filterNodeMethod: Function
},
created() {
@@ -73,7 +74,8 @@
defaultCheckedKeys: this.defaultCheckedKeys,
defaultExpandedKeys: this.defaultExpandedKeys,
autoExpandParent: this.autoExpandParent,
defaultExpandAll: this.defaultExpandAll
defaultExpandAll: this.defaultExpandAll,
filterNodeMethod: this.filterNodeMethod
});
},
@@ -109,6 +111,10 @@
},
methods: {
filter(value) {
if (!this.filterNodeMethod) throw new Error('[Tree] filterNodeMethod is required when filter');
this.tree.filter(value);
},
getCheckedNodes(leafOnly) {
return this.tree.getCheckedNodes(leafOnly);
},