From 85a1f9f2a1827734648ddef44a1a0968461aa918 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 9 May 2020 19:15:13 +0200 Subject: [PATCH] Fix listId not defined in list view switcher --- src/components/lists/ShowList.vue | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/lists/ShowList.vue b/src/components/lists/ShowList.vue index 221c89fe..b4eebc7f 100644 --- a/src/components/lists/ShowList.vue +++ b/src/components/lists/ShowList.vue @@ -10,10 +10,10 @@ It is not possible to create new or edit tasks or it.
- List - Gantt - Table - Kanban + List + Gantt + Table + Kanban
@@ -26,7 +26,7 @@ import ListModel from '../../models/list' import ListService from '../../services/list' - import {CURRENT_LIST} from "../../store/mutation-types"; + import {CURRENT_LIST} from '../../store/mutation-types' export default { data() { @@ -47,6 +47,12 @@ // call again the method if the route changes '$route.path': 'loadList', }, + computed: { + // Computed property to let "listId" always have a value + listId() { + return typeof this.$route.params.listId === 'undefined' ? 0 : this.$route.params.listId + }, + }, methods: { loadList() {