drafted router with vue-router, drafted search results display page
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user