优化添加缓存条件和不缓存条件交互

This commit is contained in:
刘祥超
2023-12-28 15:50:19 +08:00
parent c45ba38ffa
commit b7775a99ef

View File

@@ -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()