mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-08-31 19:59:47 +08:00
fix(editor): 修复 update 返回值三目运算符判断错误的问题,同时优化输入与输入类型一致。
This commit is contained in:
parent
547e733c65
commit
9b0db4a807
@ -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];
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user