mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-19 12:04:02 +08:00
Tree: add filter-node-method prop & filter method.
This commit is contained in:
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user