From 6a497c2a1ad1909f9bd2c704f7fef9bd5b97ebd0 Mon Sep 17 00:00:00 2001 From: code4fan Date: Tue, 14 Feb 2023 10:36:08 +0800 Subject: [PATCH] =?UTF-8?q?forceRelayout=E6=97=B6=EF=BC=8C=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E7=BB=93=E6=9D=9F=E5=BD=93=E5=89=8D=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=EF=BC=8C=E5=90=A6=E5=88=99=E4=BC=9A=E9=87=8D=E6=96=B0=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E5=AF=BC=E8=87=B4=E9=97=AA=E7=83=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils.js b/src/utils.js index ca0142f..875e27b 100644 --- a/src/utils.js +++ b/src/utils.js @@ -16,6 +16,8 @@ function forceRelayout(elem) { elem.style.display = 'none'; elem.offsetHeight; // eslint-disable-line elem.style.display = originalStyle; + // 结束当前动画,否则会重新执行导致闪烁 + elem.getAnimations().forEach(animation => animation.finish()); } function css(el, name, v) {