test: add test for runtime-dom/modules/class (#75)
This commit is contained in:
@@ -2,7 +2,10 @@ import { ElementWithTransition } from '../components/Transition'
|
||||
|
||||
// compiler should normalize class + :class bindings on the same element
|
||||
// into a single binding ['staticClass', dynamic]
|
||||
export function patchClass(el: Element, value: string, isSVG: boolean) {
|
||||
export function patchClass(el: Element, value: string | null, isSVG: boolean) {
|
||||
if (value == null) {
|
||||
value = ''
|
||||
}
|
||||
// directly setting className should be faster than setAttribute in theory
|
||||
if (isSVG) {
|
||||
el.setAttribute('class', value)
|
||||
|
||||
Reference in New Issue
Block a user