Skip to content

Commit

Permalink
fix: check enterToClass/leaveToClass existence before adding it (#5912)
Browse files Browse the repository at this point in the history
related: #5800
  • Loading branch information
jkzing authored and yyx990803 committed Jun 30, 2017
1 parent 049f317 commit 34d8c79
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/platforms/web/runtime/transition-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ export function nextFrame (fn: Function) {
}

export function addTransitionClass (el: any, cls: string) {
(el._transitionClasses || (el._transitionClasses = [])).push(cls)
addClass(el, cls)
const transitionClasses = el._transitionClasses || (el._transitionClasses = [])
if (transitionClasses.indexOf(cls) < 0) {
transitionClasses.push(cls)
addClass(el, cls)
}
}

export function removeTransitionClass (el: any, cls: string) {
Expand Down

0 comments on commit 34d8c79

Please sign in to comment.