浏览代码

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"