1
0

feat: provide listId prop via router

This commit is contained in:
Dominik Pschenitschni
2021-12-10 15:29:28 +01:00
parent 6d62ca1ada
commit 5916a44724
10 changed files with 263 additions and 233 deletions

View File

@ -475,6 +475,14 @@ export default {
description,
heading,
},
props: {
taskId: {
type: Number,
required: true,
},
},
data() {
return {
taskService: new TaskService(),
@ -525,10 +533,6 @@ export default {
},
},
computed: {
taskId() {
const {id} = this.$route.params
return id === undefined ? id : Number(id)
},
currentList() {
return this.$store.state[CURRENT_LIST]
},

View File

@ -7,15 +7,22 @@
<a @click="close()" class="close">
<icon icon="times"/>
</a>
<task-detail-view/>
<task-detail-view :task-id="props.taskId"/>
</modal>
</template>
<script setup>
<script setup lang="ts">
import {computed} from 'vue'
import {useRouter, useRoute} from 'vue-router'
import TaskDetailView from './TaskDetailView'
import TaskDetailView from './TaskDetailView.vue'
const props = defineProps({
taskId: {
type: Number,
required: true,
},
})
const route = useRoute()
const historyState = computed(() => route.fullPath && window.history.state)