From c776ea6f8bfed3889accfcb66394ff0c73d5b873 Mon Sep 17 00:00:00 2001 From: hay-kot Date: Thu, 6 May 2021 16:02:57 -0800 Subject: [PATCH] add query parameter to search page --- frontend/src/pages/SearchPage/index.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/SearchPage/index.vue b/frontend/src/pages/SearchPage/index.vue index 63b4700e5..e3f059add 100644 --- a/frontend/src/pages/SearchPage/index.vue +++ b/frontend/src/pages/SearchPage/index.vue @@ -65,7 +65,6 @@ export default { }, data() { return { - searchString: "", maxResults: 21, searchResults: [], catFilter: { @@ -95,6 +94,14 @@ export default { this.$store.dispatch("requestAllRecipes"); }, computed: { + searchString: { + set(q) { + this.$router.replace({ query: { ...this.$route.query, q } }); + }, + get() { + return this.$route.query.q || ""; + }, + }, allRecipes() { return this.$store.getters.getAllRecipes; },