1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
| <template>
| <div>
| <md-list>
| <!-- TODO - change to an actual KEY when i connect to the DB -->
| <div v-for="item in todos" :key="item.id" >
| <TodoItem
| :todoItem=item
| ></TodoItem>
| </div>
| </md-list>
| </div>
| </template>
|
|
| <script>
| import TodoItem from "@/components/TodoItem.vue";
| import { mapGetters } from "vuex";
|
| export default {
| name: "ListOfTodos",
| props: {},
| components: {
| TodoItem
| },
| computed: {
| ...mapGetters(["todos"])
| },
| created() {
| this.$store.dispatch("loadTodos");
| }
| };
| </script>
|
| <!-- Add "scoped" attribute to limit CSS to this component only -->
| <style scoped lang="scss">
| </style>
|
|