started search but api bugged

This commit is contained in:
2019-09-18 11:40:50 +02:00
parent 2f3b6bbdf1
commit 1a0964d955
2 changed files with 17 additions and 12 deletions
+10 -9
View File
@@ -1,11 +1,11 @@
<template>
<div id="search">
<form class="" action="index.html" method="post">
<label for="keywords">
<label for="keys">
Search
<input
id="keywords"
v-model="keywords"
id="keys"
v-model="keys"
type="text"
placeholder="search"
>
@@ -24,24 +24,25 @@
<script>
import { mapState, mapActions } from 'vuex'
import { mapActions } from 'vuex'
export default {
name: 'Search',
// data: () => ({
// keywords: ''
// typed: ''
// }),
computed: {
...mapState({
keywords: state => state.Search.keywords
})
keys: {
get () { return this.$store.state.Search.keys },
set (value) { this.$store.commit('Search/setKeys', value) }
}
},
methods: {
...mapActions({
getResults: 'Search/getResults'
}),
submit () {
console.log('submited', this.keywords)
console.log('submited', this.keys)
this.getResults()
}
}