Skip to content

Commit

Permalink
fix(transition): handle multiple transition classes (#638) (#645)
Browse files Browse the repository at this point in the history
fix #638
  • Loading branch information
yang authored and yyx990803 committed Jan 20, 2020
1 parent 5aa9868 commit 98d50d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/runtime-dom/src/components/Transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ export interface ElementWithTransition extends HTMLElement {
}

export function addTransitionClass(el: ElementWithTransition, cls: string) {
el.classList.add(cls)
cls.split(/\s+/).forEach(c => c && el.classList.add(c))
;(el._vtc || (el._vtc = new Set())).add(cls)
}

export function removeTransitionClass(el: ElementWithTransition, cls: string) {
el.classList.remove(cls)
cls.split(/\s+/).forEach(c => c && el.classList.remove(c))
if (el._vtc) {
el._vtc.delete(cls)
if (!el._vtc!.size) {
Expand Down

0 comments on commit 98d50d8

Please sign in to comment.