Преглед изворни кода

fix: fix conditional tabs not rerendering

Andrew Bastin пре 4 година
родитељ
комит
47b341d50e
1 измењених фајлова са 10 додато и 0 уклоњено
  1. 10 0
      packages/hoppscotch-app/components/smart/Tabs.vue

+ 10 - 0
packages/hoppscotch-app/components/smart/Tabs.vue

@@ -74,6 +74,16 @@ export default defineComponent({
     }
   },
 
+  updated() {
+    const candidates = this.$children.filter(
+      (child) => child.$options.name === "SmartTab"
+    )
+
+    if (candidates.length !== this.tabs.length) {
+      this.tabs = candidates
+    }
+  },
+
   mounted() {
     this.tabs = this.$children.filter(
       (child) => child.$options.name === "SmartTab"