提交 1b4aa27e 编写于 作者: fxy060608's avatar fxy060608

feat(app): reduce queuePostFlushCb

上级 a4c64908
......@@ -10458,6 +10458,7 @@ var serviceContext = (function (vue) {
super(NODE_TYPE_PAGE, '#page', null);
this._id = 1;
this._created = false;
this._updating = false;
this._createActionMap = new Map();
this.updateActions = [];
this.dicts = [];
......@@ -10589,7 +10590,10 @@ var serviceContext = (function (vue) {
if (action[0] !== ACTION_TYPE_INSERT) {
this.updateActions.push(action);
}
vue.queuePostFlushCb(this._update);
if (!this._updating) {
this._updating = true;
vue.queuePostFlushCb(this._update);
}
}
restore() {
this.clear();
......@@ -10631,6 +10635,7 @@ var serviceContext = (function (vue) {
clear() {
this.dicts.length = 0;
this.updateActions.length = 0;
this._updating = false;
this._createActionMap.clear();
}
send(action) {
......
......@@ -44,6 +44,7 @@ export default class UniPageNode extends UniNode implements IUniPageNode {
pageId: number
private _id: number = 1
private _created: boolean = false
private _updating: boolean = false
private options: PageNodeOptions
private createAction: PageCreateAction
private createdAction: PageCreatedAction
......@@ -221,7 +222,10 @@ export default class UniPageNode extends UniNode implements IUniPageNode {
if (action[0] !== ACTION_TYPE_INSERT) {
this.updateActions.push(action)
}
queuePostFlushCb(this._update)
if (!this._updating) {
this._updating = true
queuePostFlushCb(this._update)
}
}
restore() {
this.clear()
......@@ -270,6 +274,7 @@ export default class UniPageNode extends UniNode implements IUniPageNode {
clear() {
this.dicts.length = 0
this.updateActions.length = 0
this._updating = false
this._createActionMap.clear()
}
send(action: (PageAction | DictAction)[]) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册