fix: 复制之后 fieldId 重复

This commit is contained in:
mario.gk 2020-08-06 14:49:00 +08:00
parent cd1fada132
commit 36621ea55c
2 changed files with 9 additions and 1 deletions

View File

@ -383,7 +383,10 @@ const builtinComponentActions: ComponentAction[] = [
action(node: Node) {
// node.remove();
const { document: doc, parent, index } = node;
parent && doc.insertNode(parent, node, index, true);
if (parent) {
const newNode = doc.insertNode(parent, node, index + 1, true);
newNode.select();
}
},
},
important: true,

View File

@ -70,6 +70,11 @@ export class Prop implements IPropParent {
return undefined;
}
// 兼容 vision 之前逻辑
if (this.key === 'fieldId' && stage === TransformStage.Clone) {
return undefined;
}
if (type === 'literal' || type === 'expression') {
// TODO 后端改造之后删除此逻辑
if (this._value === null && stage === TransformStage.Save) {