Update DomHandler.js

pull/4107/head
mertsincan 2023-07-04 01:12:39 +01:00
parent f23e5adc07
commit d9baf298d5
1 changed files with 2 additions and 2 deletions

View File

@ -185,7 +185,7 @@ export default {
setAttributes(element, attributes = {}) {
if (element) {
const computedStyles = (rule, value) => {
const styles = element?.$attr?.[rule] ? [element?.$attr?.[rule]] : [];
const styles = element?.$attrs?.[rule] ? [element?.$attrs?.[rule]] : [];
return [value].flat().reduce((cv, v) => {
if (v !== null && v !== undefined) {
@ -216,7 +216,7 @@ export default {
this.setAttributes(element, value);
} else {
value = key === 'class' ? [...new Set(computedStyles('class', value))].join(' ').trim() : key === 'style' ? computedStyles('style', value).join(';').trim() : value;
(element.$attr = element.$attr || {}) && (element.$attr[key] = value);
(element.$attrs = element.$attrs || {}) && (element.$attrs[key] = value);
element.setAttribute(key, value);
}
}