Prefill search input from query

This commit is contained in:
Lucas Verney 2017-05-05 11:12:57 +02:00
parent e0f8434877
commit 7cec9dcec2

View File

@ -36,6 +36,14 @@ export default {
this.doSearch() this.doSearch()
}, },
mounted () {
// Fill-in the value of the input
const query = this.$route.query.query
if (query) {
this.$refs.searchInput.value = query
}
},
watch: { watch: {
'$route': 'doSearch' '$route': 'doSearch'
}, },
@ -47,7 +55,7 @@ export default {
} }
return this.$store.getters.postalCodesFlatsBuckets( 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 () { loading () {