Skip to content

Commit 657eb97

Browse files
authored
feat(life-circle): view 生命周期事件触发,携带事件内容 (#3288)
1 parent 22188ca commit 657eb97

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/chart/view.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ export class View extends Base {
787787
*/
788788
public changeData(data: Data) {
789789
this.isDataChanged = true;
790-
this.emit(VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA);
790+
this.emit(VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA, Event.fromData(this, VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA, null));
791791
// 1. 保存数据
792792
this.data(data);
793793

@@ -802,7 +802,7 @@ export class View extends Base {
802802
view.changeData(data);
803803
}
804804

805-
this.emit(VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA);
805+
this.emit(VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA, Event.fromData(this, VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA, null));
806806
}
807807

808808
/* View 管理相关的 API */

0 commit comments

Comments
 (0)