diff --git a/src/editor/core/draw/Draw.ts b/src/editor/core/draw/Draw.ts index 4ccbfd6..a5fd194 100644 --- a/src/editor/core/draw/Draw.ts +++ b/src/editor/core/draw/Draw.ts @@ -955,7 +955,7 @@ export class Draw { } public setValue(payload: Partial) { - const { header, main, footer } = payload + const { header, main, footer } = deepClone(payload) if (!header && !main && !footer) return const pageComponentData = [header, main, footer] pageComponentData.forEach(data => { diff --git a/src/editor/index.ts b/src/editor/index.ts index 7b69106..7871a30 100644 --- a/src/editor/index.ts +++ b/src/editor/index.ts @@ -72,7 +72,7 @@ import { IPageBreak } from './interface/PageBreak' import { LETTER_CLASS } from './dataset/constant/Common' import { INTERNAL_CONTEXT_MENU_KEY } from './dataset/constant/ContextMenu' import { IRange } from './interface/Range' -import { splitText } from './utils' +import { deepClone, splitText } from './utils' export default class Editor { public command: Command @@ -190,6 +190,7 @@ export default class Editor { pageBreak: pageBreakOptions } // 数据处理 + data = deepClone(data) let headerElementList: IElement[] = [] let mainElementList: IElement[] = [] let footerElementList: IElement[] = []