|
|
@ -17,16 +17,18 @@ |
|
|
|
if (!cls) { |
|
|
|
if (!cls) { |
|
|
|
throw new Error("组件" + config.type + "未定义"); |
|
|
|
throw new Error("组件" + config.type + "未定义"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var pushed = false; |
|
|
|
|
|
|
|
if (context) { |
|
|
|
|
|
|
|
pushed = true; |
|
|
|
|
|
|
|
BI.Widget.pushContext(context); |
|
|
|
|
|
|
|
} |
|
|
|
var widget = new cls(); |
|
|
|
var widget = new cls(); |
|
|
|
widget._context = context; |
|
|
|
|
|
|
|
BI.Widget.pushContext(widget); |
|
|
|
|
|
|
|
widget._initProps(config); |
|
|
|
widget._initProps(config); |
|
|
|
widget._initRoot(); |
|
|
|
widget._initRoot(); |
|
|
|
if (!lazy || config.element || config.root) { |
|
|
|
// if (!lazy || config.element || config.root) {
|
|
|
|
widget._lazyConstructor(); |
|
|
|
widget._lazyConstructor(); |
|
|
|
} |
|
|
|
// }
|
|
|
|
BI.Widget.popContext(); |
|
|
|
pushed && BI.Widget.popContext(); |
|
|
|
return widget; |
|
|
|
return widget; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|