11.3 Display Tasks and Completed in own list

This commit is contained in:
Fredrick W Warren 2021-02-10 10:14:31 -08:00
parent 36f6285e24
commit 76f839a587
3 changed files with 79 additions and 14 deletions

View File

@ -0,0 +1,33 @@
<template>
<q-list
v-if="Object.keys(tasksCompleted).length"
separator
bordered>
<task
v-for="(task, key) in tasksCompleted"
:key="key"
:task="task"
:id="key"
></task>
</q-list>
</template>
<script>
import task from 'components/Tasks/Task.vue'
export default {
name: 'TasksCompleted',
components: {
task
},
props: [
'tasksCompleted'
]
}
</script>
<style>
</style>

View File

@ -0,0 +1,33 @@
<template>
<q-list
v-if="Object.keys(tasksTodo).length"
separator
bordered>
<task
v-for="(task, key) in tasksTodo"
:key="key"
:task="task"
:id="key"
></task>
</q-list>
</template>
<script>
import task from 'components/Tasks/Task.vue'
export default {
name: 'TasksTodo',
components: {
task
},
props: [
'tasksTodo'
]
}
</script>
<style>
</style>

View File

@ -1,18 +1,13 @@
<template> <template>
<q-page class="q-pa-md"> <q-page class="q-pa-md">
<q-list
v-if="Object.keys(tasksTodo).length"
separator
bordered>
<task <tasks-todo
v-for="(task, key) in tasksTodo" :tasksTodo="tasksTodo" />
:key="key"
:task="task"
:id="key"
></task>
</q-list> <hr>
<tasks-completed
:tasksCompleted="tasksCompleted" />
<div class="absolute-bottom text-center q-mb-lg"> <div class="absolute-bottom text-center q-mb-lg">
<q-btn <q-btn
@ -33,12 +28,16 @@
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import tasksTodo from 'components/Tasks/TasksTodo.vue'
import tasksCompleted from 'components/Tasks/TasksCompleted.vue'
import addTask from 'components/Tasks/Modals/AddTask.vue'
export default { export default {
name: 'PageTodo', name: 'PageTodo',
components: { components: {
task: require('components/Tasks/Task.vue').default, tasksTodo,
addTask: require('components/Tasks/Modals/AddTask.vue').default tasksCompleted,
addTask
}, },
data () { data () {
return { return {
@ -46,7 +45,7 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters('tasks', ['tasksTodo']) ...mapGetters('tasks', ['tasksTodo', 'tasksCompleted'])
} }
} }
</script> </script>