JSFiddle - React, Tailwind, and code Playground
JavaScript
enyo.kind({
name:'ComponentsWrapper',
components:[
{
name:'wrapper',
style:'background-color:red;padding:10px;'
}
],
constructor:function(props){
this.newComponents = props.components;
props.components = [];
this.inherited(arguments);
},
create:function(props){
this.inherited(arguments);
if(typeof this.$.wrapper !== 'undefined'
&& typeof this.newComponents === 'object'){
for(i in this.newComponents){
this.$.wrapper.createComponent(this.newComponents[i],{owner:this});
}
}
}
});
var _test = new ComponentsWrapper({ components: [
{
name:'wrapped',
style:'background-color:green;padding:10px;'
}
] });
_test.renderInto(document.body);