From 7cec9dcec2458604bb443eba9c8dc784fcf08b8e Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Fri, 5 May 2017 11:12:57 +0200 Subject: [PATCH] Prefill search input from query --- flatisfy/web/js_src/views/search.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/flatisfy/web/js_src/views/search.vue b/flatisfy/web/js_src/views/search.vue index 0860a36..6c7ed7e 100644 --- a/flatisfy/web/js_src/views/search.vue +++ b/flatisfy/web/js_src/views/search.vue @@ -36,6 +36,14 @@ export default { this.doSearch() }, + mounted () { + // Fill-in the value of the input + const query = this.$route.query.query + if (query) { + this.$refs.searchInput.value = query + } + }, + watch: { '$route': 'doSearch' }, @@ -47,7 +55,7 @@ export default { } return this.$store.getters.postalCodesFlatsBuckets( - flat => flat.status !== 'duplicate' && flat.status !== 'ignored' && flat.status !== "user_deleted" + flat => flat.status !== 'duplicate' && flat.status !== 'ignored' && flat.status !== 'user_deleted' ) }, loading () {