From 2d17ce3d6e034da5bb5e1d65c03244a4147c9bf0 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 17 Apr 2024 17:34:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=8E=AF=E5=A2=83=E5=8F=82=E6=95=B0=E7=9A=84?= =?UTF-8?q?=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1039380 --user=王孝刚 【项目环境】通用变量处存在分页,在其他页输入参数名后,点击后面输入框,会跳转到第一页 https://www.tapd.cn/55049933/s/1499947 --- .../environment/commons/ApiScenarioVariables.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue b/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue index 500723e9fe..66848b3d57 100644 --- a/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue +++ b/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue @@ -431,9 +431,8 @@ export default { scope: "api", }) ); - this.currentPage = Math.ceil(this.items.length / this.pageSize); } - this.filter(); + this.filter(this.currentPage); // 触发变更事件 this.$emit("change", this.items); @@ -593,9 +592,9 @@ export default { } ); }, - filter() { + filter(currentPage) { // 过滤 - this.currentPage = 1; + this.currentPage = typeof currentPage === "number" ? currentPage : 1; this.allData = []; this._filter(); this.sortParameters();