From 6b338318e3e75c103f74a9fb4d3a12d805f739e1 Mon Sep 17 00:00:00 2001 From: Jo Li Date: Mon, 23 Dec 2024 11:11:16 +0800 Subject: [PATCH] Fix the problem that the slider is not centered on the first click. --- uni_modules/uview-ui/components/u-tabs/u-tabs.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/uni_modules/uview-ui/components/u-tabs/u-tabs.vue b/uni_modules/uview-ui/components/u-tabs/u-tabs.vue index d2b3b039..b9d41d54 100644 --- a/uni_modules/uview-ui/components/u-tabs/u-tabs.vue +++ b/uni_modules/uview-ui/components/u-tabs/u-tabs.vue @@ -204,7 +204,9 @@ // 如果disabled状态,返回 if (item.disabled) return this.innerCurrent = index - this.resize() + uni.$u.sleep().then(() => { + this.resize() + }) this.$emit('change', { ...item, index