1906 FIX search form autocomplete multi terms
This commit is contained in:
@ -66,8 +66,11 @@ export default {
|
||||
console.log('Base created() location',window.location)
|
||||
let params = new URLSearchParams(window.location.search)
|
||||
if (params.has('keys')) {
|
||||
this.$store.commit('Search/setKeys', params.get('keys'))
|
||||
this.pagetitle = params.get('keys')
|
||||
const r = /,\s?$/
|
||||
let keys = params.get('keys').replace(r,'').split(', ')
|
||||
console.log('Base created, keys', keys)
|
||||
this.$store.commit('Search/setKeys', keys)
|
||||
this.pagetitle = keys.join(', ') //params.get('keys')
|
||||
} else {
|
||||
this.$store.commit('Search/setKeys', '')
|
||||
this.pagetitle = 'Base'
|
||||
@ -92,7 +95,13 @@ export default {
|
||||
beforeRouteUpdate (to, from, next) {
|
||||
// when query change launch a new search
|
||||
console.log('Base beforeRouteUpdate', to, from, next)
|
||||
this.$store.commit('Search/setKeys', to.query.keys)
|
||||
|
||||
// this.$store.commit('Search/setKeys', to.query.keys)
|
||||
const r = /,\s?$/
|
||||
let keys = to.query.keys.replace(r,'').split(', ')
|
||||
console.log('Base created, keys', keys)
|
||||
this.$store.commit('Search/setKeys', keys)
|
||||
|
||||
this.$store.commit('Search/setTerms', to.query.terms)
|
||||
this.$store.commit('Search/setFilters', to.query.filters)
|
||||
this.pagetitle = to.query.keys
|
||||
|
Reference in New Issue
Block a user