From e50963903d93a7f24003b6e2c03647fdf7454b1e Mon Sep 17 00:00:00 2001 From: zhoulixiang <18366276315@163.com> Date: Tue, 13 Feb 2024 12:56:52 +0800 Subject: [PATCH] fix(runtime-dom): should not trigger transition when v-show value is falsy (#10311) --- packages/runtime-dom/src/directives/vShow.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/runtime-dom/src/directives/vShow.ts b/packages/runtime-dom/src/directives/vShow.ts index d8aab92e71b..4bf6779edfd 100644 --- a/packages/runtime-dom/src/directives/vShow.ts +++ b/packages/runtime-dom/src/directives/vShow.ts @@ -22,7 +22,11 @@ export const vShow: ObjectDirective & { name?: 'show' } = { } }, updated(el, { value, oldValue }, { transition }) { - if (!value === !oldValue && el.style.display === el[vShowOldKey]) return + if ( + !value === !oldValue && + (el.style.display === el[vShowOldKey] || !value) + ) + return if (transition) { if (value) { transition.beforeEnter(el)