From 1ea8c4a4603afc54a108d36be462e0bc41be2f0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=8A=B2=E6=9D=BE?= Date: Thu, 16 Apr 2020 15:02:50 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20add-param-box=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E7=9A=84=E6=96=87=E5=AD=97=E6=94=B9=E6=88=90=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/rightBox/editEndpointBox.vue | 16 ++++++++++++---- .../src/components/common/rightBox/moduleBox.vue | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue b/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue index 813d38041..44e6d92a8 100644 --- a/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue +++ b/nezha-fronted/src/components/common/rightBox/editEndpointBox.vue @@ -130,10 +130,10 @@
-
@@ -251,17 +251,25 @@ // 清除param clearAllParam() { this.endpoint.paramObj = []; + this.$nextTick(() => { + this.$refs.paramBoxScrollbar.update(); + }); }, // 新增param addParam() { this.endpoint.paramObj.push({key: '', value: ''}); - this.$refs.paramBoxScrollbar.update(); + this.$nextTick(() => { + this.$refs.paramBoxScrollbar.update(); + }); }, // 移除单个param removeParam(index) { this.endpoint.paramObj.splice(index, 1); + this.$nextTick(() => { + this.$refs.paramBoxScrollbar.update(); + }); }, //将param转为json字符串格式 diff --git a/nezha-fronted/src/components/common/rightBox/moduleBox.vue b/nezha-fronted/src/components/common/rightBox/moduleBox.vue index 50fad4015..c0e02e8dd 100644 --- a/nezha-fronted/src/components/common/rightBox/moduleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/moduleBox.vue @@ -256,10 +256,10 @@
-
@@ -610,17 +610,25 @@ // 清除param clearAllParam: function() { this.currentModule.paramObj = []; + this.$nextTick(() => { + this.$refs.paramBoxScrollbar.update(); + }); }, // 新增param addParam: function() { this.currentModule.paramObj.push({key: '', value: ''}); - this.$refs.paramBoxScrollbar.update(); + this.$nextTick(() => { + this.$refs.paramBoxScrollbar.update(); + }); }, // 移除单个param removeParam: function(index) { this.currentModule.paramObj.splice(index, 1); + this.$nextTick(() => { + this.$refs.paramBoxScrollbar.update(); + }); }, //将param转为json字符串格式