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) - } - } }