From 98d50d874dcb32a246216b936e442e5b95ab4825 Mon Sep 17 00:00:00 2001 From: yang <504575307@qq.com> Date: Tue, 21 Jan 2020 01:44:01 +0800 Subject: [PATCH] fix(transition): handle multiple transition classes (#638) (#645) fix #638 --- packages/runtime-dom/src/components/Transition.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runtime-dom/src/components/Transition.ts b/packages/runtime-dom/src/components/Transition.ts index 13fd0f3f533..1a4e2c82b11 100644 --- a/packages/runtime-dom/src/components/Transition.ts +++ b/packages/runtime-dom/src/components/Transition.ts @@ -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) {