11.4 Adding List Headers

This commit is contained in:
Fredrick W Warren 2021-02-10 10:53:46 -08:00
parent 76f839a587
commit 193c0bada6
3 changed files with 33 additions and 3 deletions

View File

@ -0,0 +1,21 @@
<template>
<q-banner
dense
inline-actions
class="list-header text-white bg-orange-4 text-center">
<span class="text-bold text-subtitle1"><slot /></span>
</q-banner>
</template>
<script>
export default {
name: 'ListHeader'
}
</script>
<style>
.list-header {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
</style>

View File

@ -1,4 +1,6 @@
<template> <template>
<div>
<list-header>Completed</list-header>
<q-list <q-list
v-if="Object.keys(tasksCompleted).length" v-if="Object.keys(tasksCompleted).length"
separator separator
@ -10,17 +12,19 @@
:task="task" :task="task"
:id="key" :id="key"
></task> ></task>
</q-list> </q-list>
</div>
</template> </template>
<script> <script>
import task from 'components/Tasks/Task.vue' import task from 'components/Tasks/Task.vue'
import listHeader from 'components/Shared/ListHeader.vue'
export default { export default {
name: 'TasksCompleted', name: 'TasksCompleted',
components: { components: {
task task,
listHeader
}, },
props: [ props: [
'tasksCompleted' 'tasksCompleted'

View File

@ -1,4 +1,6 @@
<template> <template>
<div>
<list-header>Todo</list-header>
<q-list <q-list
v-if="Object.keys(tasksTodo).length" v-if="Object.keys(tasksTodo).length"
separator separator
@ -12,15 +14,18 @@
></task> ></task>
</q-list> </q-list>
</div>
</template> </template>
<script> <script>
import task from 'components/Tasks/Task.vue' import task from 'components/Tasks/Task.vue'
import listHeader from 'components/Shared/ListHeader.vue'
export default { export default {
name: 'TasksTodo', name: 'TasksTodo',
components: { components: {
task task,
listHeader
}, },
props: [ props: [
'tasksTodo' 'tasksTodo'