11.3 Connect Search Bar to Vuex State with mapState

This commit is contained in:
Fredrick W Warren 2021-02-10 12:23:29 -08:00
parent cbd65f1b0c
commit 9f7b4f75e6
2 changed files with 8 additions and 4 deletions

View File

@ -16,11 +16,14 @@
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'Search',
data () {
return {
searchField: ''
computed: {
...mapState('tasks', ['search']),
searchField () {
return this.search
}
}

View File

@ -23,7 +23,8 @@ const state = {
dueTime: '16:30'
}
*/
}
},
search: ''
}
const mutations = {