11.7 Display “No search results” & Hide the “No tasks today” Banner

This commit is contained in:
Fredrick W Warren 2021-02-10 15:00:21 -08:00
parent 001b7c6b85
commit 6bde7fce56

View File

@ -5,11 +5,15 @@
<search />
</div>
<p
v-if="search && !Object.keys(tasksTodo).length && !Object.keys(tasksCompleted).length">
No Search Results
</p>
<noTasks
v-if="!Object.keys(tasksTodo).length" />
v-if="!Object.keys(tasksTodo).length && !search" />
<tasks-todo
v-else
v-if="Object.keys(tasksTodo).length"
:tasksTodo="tasksTodo" />
<tasks-completed
@ -34,7 +38,7 @@
</template>
<script>
import { mapGetters } from 'vuex'
import { mapGetters, mapState } from 'vuex'
import tasksTodo from 'components/Tasks/TasksTodo.vue'
import noTasks from 'components/Tasks/NoTasks.vue'
import tasksCompleted from 'components/Tasks/TasksCompleted.vue'
@ -56,7 +60,8 @@ export default {
}
},
computed: {
...mapGetters('tasks', ['tasksTodo', 'tasksCompleted'])
...mapGetters('tasks', ['tasksTodo', 'tasksCompleted']),
...mapState('tasks', ['search'])
},
mounted () {
this.$root.$on('showAddTask', () => {