Skip to content

Commit

Permalink
fix(runtime-dom): should not trigger transition when v-show value is …
Browse files Browse the repository at this point in the history
…falsy (#10311)
  • Loading branch information
zh-lx committed Feb 13, 2024
1 parent 603a1e1 commit e509639
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/runtime-dom/src/directives/vShow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e509639

Please sign in to comment.