11.3 Connect Search Bar to Vuex State with mapState
This commit is contained in:
parent
cbd65f1b0c
commit
9f7b4f75e6
@ -16,11 +16,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Search',
|
name: 'Search',
|
||||||
data () {
|
computed: {
|
||||||
return {
|
...mapState('tasks', ['search']),
|
||||||
searchField: ''
|
searchField () {
|
||||||
|
return this.search
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,8 @@ const state = {
|
|||||||
dueTime: '16:30'
|
dueTime: '16:30'
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
},
|
||||||
|
search: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const mutations = {
|
const mutations = {
|
||||||
|
Loading…
Reference in New Issue
Block a user