From b7775a99ef62b44adc633c20f54a737c010f769d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Thu, 28 Dec 2023 15:50:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B7=BB=E5=8A=A0=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E6=9D=A1=E4=BB=B6=E5=92=8C=E4=B8=8D=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/http-cache-refs-config-box.js | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/web/public/js/components/server/http-cache-refs-config-box.js b/web/public/js/components/server/http-cache-refs-config-box.js index 3c75368c..0dd67a13 100644 --- a/web/public/js/components/server/http-cache-refs-config-box.js +++ b/web/public/js/components/server/http-cache-refs-config-box.js @@ -79,7 +79,17 @@ Vue.component("http-cache-refs-config-box", { that.refs.push(newRef) } - that.change() + // move to bottom + var afterChangeCallback = function () { + setTimeout(function () { + let rightBox = document.querySelector(".right-box") + if (rightBox != null) { + rightBox.scrollTo(0, isReverse ? 0 : 100000) + } + }, 100) + } + + that.change(afterChangeCallback) } }) }, @@ -140,7 +150,7 @@ Vue.component("http-cache-refs-config-box", { } return unit }, - change: function () { + change: function (callback) { this.$forceUpdate() // 自动保存 @@ -159,7 +169,11 @@ Vue.component("http-cache-refs-config-box", { }) .success(function (resp) { if (resp.data.isUpdated) { - teaweb.successToast("保存成功") + teaweb.successToast("保存成功", null, function () { + if (typeof callback == "function") { + callback() + } + }) } }) .post()