fix(utils.dom): fix utils.dom error (#21049)

In IE browser, If the reference element(slot="reference") under the popover component is a SVG element, an error will be reported.

[#21048](https://github.com/ElemeFE/element/issues/21048)
pull/18918/head^2
fw6 2021-06-24 15:51:35 +08:00 committed by GitHub
parent 318e89b40a
commit cde441fb79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -91,7 +91,7 @@ export function addClass(el, cls) {
} }
} }
if (!el.classList) { if (!el.classList) {
el.className = curClass; el.setAttribute('class', curClass);
} }
}; };
@ -112,7 +112,7 @@ export function removeClass(el, cls) {
} }
} }
if (!el.classList) { if (!el.classList) {
el.className = trim(curClass); el.setAttribute('class', trim(curClass));
} }
}; };