From 83d1168f268fb69a0bd4b88465475f4597edbd39 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Sat, 20 Dec 2025 21:32:53 +0100 Subject: [PATCH] Refactor speedLabel method in SaleSection component to move it from computed properties to methods for better compatibility with Vue3. This change ensures the function is callable and maintains its intended functionality. --- frontend/src/components/falukant/SaleSection.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/falukant/SaleSection.vue b/frontend/src/components/falukant/SaleSection.vue index 6e01727..9b73794 100644 --- a/frontend/src/components/falukant/SaleSection.vue +++ b/frontend/src/components/falukant/SaleSection.vue @@ -261,13 +261,6 @@ return new Date(a.eta).getTime() - new Date(b.eta).getTime(); }); }, - speedLabel(value) { - const key = value == null ? 'unknown' : String(value); - const tKey = `falukant.branch.transport.speed.${key}`; - const translated = this.$t(tKey); - if (!translated || translated === tKey) return value; - return translated; - }, }, async mounted() { await this.loadInventory(); @@ -284,6 +277,14 @@ } }, methods: { + speedLabel(value) { + // Muss in methods liegen (Vue3): in computed wäre es ein Getter und keine aufrufbare Funktion. + const key = value == null ? 'unknown' : String(value); + const tKey = `falukant.branch.transport.speed.${key}`; + const translated = this.$t(tKey); + if (!translated || translated === tKey) return value; + return translated; + }, async loadInventory() { try { const response = await apiClient.get(`/api/falukant/inventory/${this.branchId}`);