Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/util/dispatcher/regularModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ NEJ.define([
_pro.__build = function(){
this._$innerModule = new this._$$InnerModule().$inject(this.__body);
this.__export.parent = this._$innerModule.$refs.view;
//通过_export将父组件传递给子组件
this.__export.parentMoudle = this._$innerModule;

this._$innerModule.__doSendMessage = this.__doSendMessage._$bind(this);
}
Expand Down Expand Up @@ -64,6 +66,8 @@ NEJ.define([
if(this._$innerModule.__onShow){
this._$innerModule.data.$param = _options.param;
this._$innerModule.data.$params = _options.href.split('?')[1];
//将通过__export传递过来的parent赋值给当前组价,并将parent的child设置成当前组件
this._$innerModule.$parentModule=_options.data.parentModule;
this._$innerModule.__onShow(_options);
this._$innerModule.$update();
}
Expand Down Expand Up @@ -138,6 +142,7 @@ NEJ.define([
*/
_pro.__destroy = function(){
this.__body = _t._$getNodeTemplate(this.__nodeKey);
this._$innerModule.$parentModule=undefined;
this._$innerModule.destroy();
delete this.__nodeKey;
this.__super();
Expand Down