fix: not copy control postfix style #631
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
|||||||
EDITOR_ELEMENT_STYLE_ATTR,
|
EDITOR_ELEMENT_STYLE_ATTR,
|
||||||
EDITOR_ROW_ATTR
|
EDITOR_ROW_ATTR
|
||||||
} from '../../../../dataset/constant/Element'
|
} from '../../../../dataset/constant/Element'
|
||||||
|
import { ControlComponent } from '../../../../dataset/enum/Control'
|
||||||
import { IElement } from '../../../../interface/Element'
|
import { IElement } from '../../../../interface/Element'
|
||||||
import {
|
import {
|
||||||
formatElementContext,
|
formatElementContext,
|
||||||
@@ -49,7 +50,11 @@ export function enter(evt: KeyboardEvent, host: CanvasEvent) {
|
|||||||
// 复制样式属性
|
// 复制样式属性
|
||||||
const copyElement = getAnchorElement(elementList, endIndex)
|
const copyElement = getAnchorElement(elementList, endIndex)
|
||||||
if (copyElement) {
|
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 => {
|
copyAttr.forEach(attr => {
|
||||||
const value = copyElement[attr] as never
|
const value = copyElement[attr] as never
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
|
|||||||
Reference in New Issue
Block a user