@alexgyver/component 1.0.11 → 1.0.14
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 +10 -1
- package/package.json +1 -1
package/component.js
CHANGED
|
@@ -130,9 +130,18 @@ export class Component {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
break;
|
|
133
|
-
default: $el
|
|
133
|
+
default: $el.setAttribute(key, val); break;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
return $el;
|
|
137
137
|
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Создать массив компонентов из массива объектов конфигурации
|
|
141
|
+
* @param {array} arr массив объектов конфигурации
|
|
142
|
+
* @returns {array} of Elements
|
|
143
|
+
*/
|
|
144
|
+
static makeArray(arr) {
|
|
145
|
+
return arr.map(x => Component.make(x.tag, x));
|
|
146
|
+
}
|
|
138
147
|
}
|