Skip to content

Commit 98d50d8

Browse files
yangyyx990803
yang
authored andcommitted
fix(transition): handle multiple transition classes (#638) (#645)
fix #638
1 parent 5aa9868 commit 98d50d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/runtime-dom/src/components/Transition.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,12 @@ export interface ElementWithTransition extends HTMLElement {
200200
}
201201

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

207207
export function removeTransitionClass(el: ElementWithTransition, cls: string) {
208-
el.classList.remove(cls)
208+
cls.split(/\s+/).forEach(c => c && el.classList.remove(c))
209209
if (el._vtc) {
210210
el._vtc.delete(cls)
211211
if (!el._vtc!.size) {

0 commit comments

Comments
 (0)