@alexgyver/component 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Component.js +2 -0
- package/package.json +1 -1
package/Component.js
CHANGED
|
@@ -112,7 +112,9 @@ export class Component {
|
|
|
112
112
|
case 'parent': if (val instanceof Node || val instanceof DocumentFragment) val.append(el); break;
|
|
113
113
|
case 'attrs': for (let attr in val) el.setAttribute(attr, val[attr]); break;
|
|
114
114
|
case 'props': for (let prop in val) el[prop] = val[prop]; break;
|
|
115
|
+
case 'child_r': el.replaceChildren();
|
|
115
116
|
case 'child': addChild(val); break;
|
|
117
|
+
case 'children_r': el.replaceChildren();
|
|
116
118
|
case 'children': for (const obj of val) addChild(obj); break;
|
|
117
119
|
case 'style':
|
|
118
120
|
if (typeof val === 'string') el.style.cssText += (val + ';');
|