Add 'filter'-event to Tree.vue

This commit is contained in:
Maximilian Röttgen 2023-11-23 16:48:14 +01:00
parent 1100647eee
commit 2603b7a140
3 changed files with 38 additions and 4 deletions

View file

@ -47,7 +47,7 @@ import TreeNode from './TreeNode.vue';
export default {
name: 'Tree',
extends: BaseTree,
emits: ['node-expand', 'node-collapse', 'update:expandedKeys', 'update:selectionKeys', 'node-select', 'node-unselect'],
emits: ['node-expand', 'node-collapse', 'update:expandedKeys', 'update:selectionKeys', 'node-select', 'node-unselect', 'filter'],
data() {
return {
d_expandedKeys: this.expandedKeys || {},
@ -166,6 +166,8 @@ export default {
if (event.code === 'Enter') {
event.preventDefault();
}
this.$emit('filter', { originalEvent: event, value: event.target.value });
},
findFilteredNodes(node, paramsWithoutNode) {
if (node) {