Skip to content
Open
Changes from 1 commit
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
9 changes: 9 additions & 0 deletions src/Action.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,15 @@ define(
this.view = null;
}

/**
* 如果Action本身也有dispose方法,则执行
* 主要用来dispose掉一些DOM事就绑定,因为我们经常在Action中通过bindEvent来绑定DOM事件
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

绑定 DOM 事件为什么不是在 View 里做的?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同意楼上,这个调用dispose的逻辑本身没问题,注释最好改改,太误导人

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

恩,注释改了

* 而destroyEvents只能dispose掉er事件
*/
if (typeof this.dispose === 'function') {
this.dispose();
}

/**
* @event leave
*
Expand Down