Vue.component('component-search', { data: function() { return { entity: "", visible: false, callback: undefined } }, methods: { activate(event) { this.entity = ""; this.$refs.tree.reset(); this.visible = true; this.callback = event.callback; }, deactivate() { this.visible = false; this.callback = undefined; }, e_set_entity(event) { this.callback(event.entity); this.deactivate(); } }, computed: { visibility: function() { if (this.visible) { return "visible"; } else { return "hidden"; } } }, template: `