#1906 serach form autocmplete multi terms

This commit is contained in:
2022-08-12 17:00:49 +02:00
parent 75ea440f89
commit d1b4902aa3
11 changed files with 96 additions and 55 deletions

View File

@ -73,10 +73,12 @@ export default {
this.pagetitle = 'Base'
}
if (params.has('term')) {
this.$store.commit('Search/setTerm', params.get('term'))
if (params.has('terms')) {
console.log('Base created, has terms', params.get('terms'))
// this.$store.commit('Search/setTerms', params.get('terms').split(','))
this.$store.commit('Search/setTerms', JSON.parse(params.get('terms')))
} else {
this.$store.commit('Search/setTerm', '')
this.$store.commit('Search/setTerms', [])
}
if (params.has('filters')) {
@ -91,7 +93,7 @@ export default {
// 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/setTerm', to.query.term)
this.$store.commit('Search/setTerms', to.query.terms)
this.$store.commit('Search/setFilters', to.query.filters)
this.pagetitle = to.query.keys
this.newSearch()