Browse Source
fix(runtime-dom): should not trigger transition when v-show value is falsy (#10311)
pull/10350/head
zhoulixiang
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
5 additions and
1 deletions
-
packages/runtime-dom/src/directives/vShow.ts
|
|
@ -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) |
|
|
|