0👍
mapState is a helper that simplifies creating a computed property that reflects the value of a given state
You can access your data like below:
<template>
<div>
<h4>Todo list</h4>
<todo
v-for="(task, index) in todos"
:key="index"
:todo="todo"
></todo>
</div>
</template>
import { mapState } from 'vuex'
export default {
data: {},
computed: {
...mapState({
todos: state => state.todos
})
}
}
Source:stackexchange.com