save and navigate to home where we see tasks
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { createUuid } from '@/shared/create-uuid'
|
||||
import { faker } from '@faker-js/faker'
|
||||
import { computed, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { createStepFixture } from '../models/step.fixture'
|
||||
@@ -12,7 +13,7 @@ const router = useRouter()
|
||||
|
||||
const id = createUuid()
|
||||
|
||||
const title = ref('')
|
||||
const title = ref(faker.animal.bird())
|
||||
const steps = ref([createStepFixture(), createStepFixture()])
|
||||
const totalEstimation = computed(() =>
|
||||
steps.value.map((step) => step.estimation).reduce((a, b) => a + b, 0)
|
||||
|
||||
18
src/use-cases/task/components/TaskList.vue
Normal file
18
src/use-cases/task/components/TaskList.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
import { useTaskStore } from '@/use-cases/task/stores/useTask.store'
|
||||
|
||||
const taskStore = useTaskStore()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ul class="task-list">
|
||||
<li v-for="task in taskStore.tasks" :key="task.id">
|
||||
{{ task.title }}
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.task-list {
|
||||
}
|
||||
</style>
|
||||
@@ -1,7 +1,10 @@
|
||||
<script setup lang="ts"></script>
|
||||
<script setup lang="ts">
|
||||
import TaskList from '@/use-cases/task/components/TaskList.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main>
|
||||
<RouterLink :to="{ name: 'new-task' }">New task</RouterLink>
|
||||
<task-list />
|
||||
</main>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user