aboutsummaryrefslogtreecommitdiff
path: root/src/components/SearchModal.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/SearchModal.vue')
-rw-r--r--src/components/SearchModal.vue9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/components/SearchModal.vue b/src/components/SearchModal.vue
index 91e6748..35ea0ee 100644
--- a/src/components/SearchModal.vue
+++ b/src/components/SearchModal.vue
@@ -5,6 +5,7 @@ import {TolNode, LayoutNode} from '../lib';
export default defineComponent({
props: {
layoutTree: {type: Object as PropType<LayoutNode>, required: true},
+ tolMap: {type: Object as PropType<Map<string,TolNode>>, required: true},
options: {type: Object, required: true},
},
methods: {
@@ -14,7 +15,13 @@ export default defineComponent({
}
},
onSearchEnter(){
- this.$emit('search-node', (this.$refs.searchInput as HTMLInputElement).value);
+ let searchString = (this.$refs.searchInput as HTMLInputElement).value;
+ let tolNode = this.tolMap.get(searchString);
+ if (tolNode == null){
+ console.log('No result found');
+ } else {
+ this.$emit('search-node', tolNode);
+ }
},
},
mounted(){