diff --git a/core/frontend/src/components/canvas/components/editor/Preview.vue b/core/frontend/src/components/canvas/components/editor/Preview.vue index 6669efb492..87501b528d 100644 --- a/core/frontend/src/components/canvas/components/editor/Preview.vue +++ b/core/frontend/src/components/canvas/components/editor/Preview.vue @@ -452,6 +452,7 @@ export default { return this.componentDataShow || [] }, ...mapState([ + 'sourceComponentData', 'previewCanvasScale', 'isClickComponent' ]), @@ -824,10 +825,16 @@ export default { formatPoint(value, pointScale) { return value * pointScale }, + findSourceComponent(id) { + return this.sourceComponentData.filter(element => element.id === id)[0] + }, handleScaleChange() { if (this.componentData) { const componentData = deepCopy(this.componentData) componentData.forEach(component => { + if (component.type === 'custom') { + component.style = deepCopy(this.findSourceComponent(component.id).style) + } Object.keys(component.style).forEach(key => { if (this.needToChangeHeight.includes(key)) { component.style[key] = this.format(component.style[key], this.scaleHeight) diff --git a/core/frontend/src/components/canvas/utils/utils.js b/core/frontend/src/components/canvas/utils/utils.js index 1191c1ab6a..91ed818aba 100644 --- a/core/frontend/src/components/canvas/utils/utils.js +++ b/core/frontend/src/components/canvas/utils/utils.js @@ -309,8 +309,6 @@ export function imgUrlTrans(url) { export function getNowCanvasComponentData(canvasId, showPosition) { if (showPosition && (showPosition.includes('email-task') || showPosition.includes('multiplexing'))) { return store.state.previewComponentData.filter(item => item.canvasId === canvasId) - } else if (showPosition === 'preview') { - return deepCopy(store.state.sourceComponentData.filter(item => item.canvasId === canvasId)) } else { return store.state.componentData.filter(item => item.canvasId === canvasId) }