drafted router with vue-router, drafted search results display page

This commit is contained in:
2019-06-03 13:06:44 +02:00
parent fee806afbd
commit d8e5f93c14
11 changed files with 420 additions and 53 deletions

View File

@@ -2,48 +2,30 @@
import Vue from 'vue'
import router from 'vuejs/route'
import { mapState, mapActions } from 'vuex'
export default {
router,
props: ['form'],
data() {
return {
template: null
// keys: "",
// autocomplete: ""
template: null,
keys: "",
autocomplete: ""
}
},
computed: {
// ...mapState(['Search'])
// ...mapState({
// // keys: state => state.Search.keys,
// autocomplete: state => state.Search.autocomplete
// }),
keys: {
get(){
return this.$store.state.Search.keys
},
set(value){
this.$store.commit('Search/setKeys', value)
}
},
autocomplete: {
get(){
return this.$store.state.Search.autocomplete
},
set(value){
this.$store.commit('Search/setAutocomplete', value)
}
}
},
methods: {
...mapActions({
getResults: 'Search/getResults'
newSearch: 'Search/newSearch'
}),
submit() {
console.log("search clicked", this.keys, this.autocomplete);
this.getResults();
this.newSearch(this.keys, this.autocomplete)
.then(() => {
this.$router.push({name:'base'})
});
},
onAutoCompleteSelect(event, ui){
event.preventDefault();