From 7daa45c2df27fdce327486049a9aa322be1c9623 Mon Sep 17 00:00:00 2001 From: Isaac Vargas Date: Thu, 19 Dec 2019 10:19:36 +0000 Subject: [PATCH] removed duplicated watcher on filter --- src/components/TreeRoot.vue | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/TreeRoot.vue b/src/components/TreeRoot.vue index a114c2e..b0be6b5 100644 --- a/src/components/TreeRoot.vue +++ b/src/components/TreeRoot.vue @@ -113,6 +113,7 @@ default: 'div' } }, + data () { // we should not mutating a prop directly... // that's why we have to create a new object @@ -134,30 +135,25 @@ draggableNode: null } }, + computed: { visibleModel() { return this.model.filter(function(node) { return node && node.visible() }) }, - visibleMatches() { return this.matches.filter(function(node) { return node && node.visible() }) } }, + watch: { filter (term) { this.tree.filter(term) } }, - - watch: { - filter (term) { - this.tree.filter(term) - } - } }