refactored search, resolve #821

This commit is contained in:
2020-07-26 13:33:22 +02:00
parent 3ed132147c
commit c29b86a5ae
5 changed files with 118 additions and 89 deletions
+3 -3
View File
@@ -8,7 +8,7 @@
>
<header class="col-1">
<h2>Resultats</h2>
<span class="search-keys">{{ keys }}</span><br>
<span class="search-keys">{{ searchedKeys }}</span><br>
<span v-if="resultsQuantity" class="results-count">{{ resultsCount }}</span>
<v-select
id="sorting"
@@ -29,8 +29,8 @@
</li>
<infinite-loading
v-if="offset < resultsQuantity.quantity"
@infinite="nextResultsBatch"
:identifier="isloading"
@infinite="nextResultsBatch"
/>
</ul>
</div>
@@ -68,7 +68,7 @@ export default {
},
...mapState({
isloading: state => state.Search.isloading,
keys: state => state.Search.keys,
searchedKeys: state => state.Search.searchedKeys,
results: state => state.Search.results,
resultsQuantity: state => state.Search.resultsQuantity,
offset: state => state.Search.offset,
+3 -2
View File
@@ -91,6 +91,7 @@ export default {
data: () => ({
}),
computed: {
// TODO: do not synch keys instantetly (infinite loading will drop)
keys: {
get () { return this.$store.state.Search.keys },
set (value) { this.$store.commit('Search/setKeys', value) }
@@ -115,15 +116,15 @@ export default {
},
methods: {
...mapMutations({
setSearchTypeValue: 'Search/setSearchTypeValue',
setActiveFilters: 'Search/setActiveFilters'
}),
...mapActions({
newSearch: 'Search/newSearch',
setSearchTypeValue: 'Search/setSearchTypeValue',
updateSearch: 'Search/updateSearch'
}),
submit () {
console.log('submited', this.keys)
// console.log('submited', this.keys)
this.newSearch()
},
dropDownMenuPos (dropdownList, component, { width }) {