]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-dom): should not trigger transition when v-show value is falsy (#10311)
authorzhoulixiang <18366276315@163.com>
Tue, 13 Feb 2024 04:56:52 +0000 (12:56 +0800)
committerGitHub <noreply@github.com>
Tue, 13 Feb 2024 04:56:52 +0000 (12:56 +0800)
packages/runtime-dom/src/directives/vShow.ts

index d8aab92e71bebd6ee02b2178e25675656eb25bca..4bf6779edfd069d02b331c59c4e96229eb68588e 100644 (file)
@@ -22,7 +22,11 @@ export const vShow: ObjectDirective<VShowElement> & { 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)