fix(editor): 修复 update 返回值三目运算符判断错误的问题,同时优化输入与输入类型一致。

This commit is contained in:
wangminghua 2022-08-23 14:36:56 +08:00 committed by jia000
parent 547e733c65
commit 9b0db4a807

View File

@ -368,7 +368,7 @@ class Editor extends BaseService {
this.emit('add', newNodes);
return newNodes.length > 1 ? newNodes : newNodes[0];
return Array.isArray(addNode) ? newNodes : newNodes[0];
}
public async doRemove(node: MNode): Promise<void> {
@ -504,7 +504,7 @@ class Editor extends BaseService {
this.emit('update', newNodes);
return newNodes.length > 1 ? newNodes[0] : newNodes;
return Array.isArray(config) ? newNodes : newNodes[0];
}
/**