diff --git a/src/editor/core/event/handlers/keydown/enter.ts b/src/editor/core/event/handlers/keydown/enter.ts index 3f1c162..7a8d0a1 100644 --- a/src/editor/core/event/handlers/keydown/enter.ts +++ b/src/editor/core/event/handlers/keydown/enter.ts @@ -3,6 +3,7 @@ import { EDITOR_ELEMENT_STYLE_ATTR, EDITOR_ROW_ATTR } from '../../../../dataset/constant/Element' +import { ControlComponent } from '../../../../dataset/enum/Control' import { IElement } from '../../../../interface/Element' import { formatElementContext, @@ -49,7 +50,11 @@ export function enter(evt: KeyboardEvent, host: CanvasEvent) { // 复制样式属性 const copyElement = getAnchorElement(elementList, endIndex) if (copyElement) { - const copyAttr = [...EDITOR_ELEMENT_STYLE_ATTR, ...EDITOR_ROW_ATTR] + const copyAttr = [...EDITOR_ROW_ATTR] + // 不复制控件后缀样式 + if (copyElement.controlComponent !== ControlComponent.POSTFIX) { + copyAttr.push(...EDITOR_ELEMENT_STYLE_ATTR) + } copyAttr.forEach(attr => { const value = copyElement[attr] as never if (value !== undefined) {