Browse Source

parameters: fix error on missing tab query parameter

Olivier Massot 2 năm trước cách đây
mục cha
commit
9cb9ef82dd
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      pages/parameters/index.vue

+ 6 - 2
pages/parameters/index.vue

@@ -107,9 +107,13 @@ Page Paramètres
 
   onMounted(() => {
     if (!route.query || !route.query.tab || !tabs.includes(route.query.tab as string)) {
-      updateQuery(tabs[0] ?? 'general_parameters')
+      const tab = tabs[0] ?? 'general_parameters'
+      currentTab.value = tab
+      updateQuery(tab)
+    } else {
+      currentTab.value = route.query.tab as string
     }
-    currentTab.value = route.query.tab as string
+
     mounted = true
   })