From ba6da32eed2b9e2111d6e20f21d797f6e36e4683 Mon Sep 17 00:00:00 2001 From: valitovgaziz Date: Mon, 25 Nov 2024 10:35:08 +0500 Subject: [PATCH] SearchBar and SerachBar results --- spa/src/components/Main.vue | 27 +++++++++++++++++++++++++-- spa/src/components/SearchBar.vue | 3 ++- spa/src/components/SearchResults.vue | 11 ++++++++--- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/spa/src/components/Main.vue b/spa/src/components/Main.vue index d87387b..3837ec1 100644 --- a/spa/src/components/Main.vue +++ b/spa/src/components/Main.vue @@ -1,8 +1,8 @@ @@ -23,6 +23,29 @@ components: { SearchBar, SearchResults + }, + methods: { + queryStr(searchQuery) { + alert(this.$refs.sdf) + this.isCentered = false; + this.$refs.searchResultsRef.showContent = true; + this.$refs.searchResultsRef.results = [ + { + "id": "asldfjk", + "title": "title1", + "description": "long description about this result" + }, + { + "id": "asladsdfjk", + "title": "title2", + "description": "long description about this result" + },{ + "id": "asldfasdfjk", + "title": "title3", + "description": "long description about this result" + } + ]; + } } }; diff --git a/spa/src/components/SearchBar.vue b/spa/src/components/SearchBar.vue index 931452d..a03d5c9 100644 --- a/spa/src/components/SearchBar.vue +++ b/spa/src/components/SearchBar.vue @@ -20,7 +20,8 @@ }, methods: { onSubmit() { - this.$emit('submit', this.searchQuery); + this.$emit('submited', this.searchQuery); + } } }; diff --git a/spa/src/components/SearchResults.vue b/spa/src/components/SearchResults.vue index 0617407..cbaf228 100644 --- a/spa/src/components/SearchResults.vue +++ b/spa/src/components/SearchResults.vue @@ -1,8 +1,7 @@