From: zhoulixiang <18366276315@163.com> Date: Tue, 13 Feb 2024 04:56:52 +0000 (+0800) Subject: fix(runtime-dom): should not trigger transition when v-show value is falsy (#10311) X-Git-Tag: v3.4.19~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e50963903d93a7f24003b6e2c03647fdf7454b1e;p=thirdparty%2Fvuejs%2Fcore.git fix(runtime-dom): should not trigger transition when v-show value is falsy (#10311) --- diff --git a/packages/runtime-dom/src/directives/vShow.ts b/packages/runtime-dom/src/directives/vShow.ts index d8aab92e71..4bf6779edf 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)