MCPcopy
hub / github.com/vuejs/core / addTransitionClass

Function addTransitionClass

packages/runtime-dom/src/components/Transition.ts:321–327  ·  view source on GitHub ↗
(el: Element, cls: string)

Source from the content-addressed store, hash-verified

319}
320
321export function addTransitionClass(el: Element, cls: string): void {
322 cls.split(/\s+/).forEach(c => c && el.classList.add(c))
323 ;(
324 (el as ElementWithTransition)[vtcKey] ||
325 ((el as ElementWithTransition)[vtcKey] = new Set())
326 ).add(cls)
327}
328
329export function removeTransitionClass(el: Element, cls: string): void {
330 cls.split(/\s+/).forEach(c => c && el.classList.remove(c))

Callers 5

setupFunction · 0.90
makeEnterHookFunction · 0.85
onBeforeEnterFunction · 0.85
onBeforeAppearFunction · 0.85
onLeaveFunction · 0.85

Calls 1

forEachMethod · 0.80

Tested by

no test coverage detected