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
parent
commit
e50963903d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      packages/runtime-dom/src/directives/vShow.ts

6
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)

Loading…
Cancel
Save