refactor(仪表板): 文本组件PC端自适应优化,可根据屏幕尺寸伸缩

This commit is contained in:
wangjiahao 2024-02-02 11:21:02 +08:00
parent a9fa29d9d7
commit 63b8ef1a70

View File

@ -816,10 +816,14 @@ export default {
component.style[key] = this.format(component.style[key], this.scaleWidth)
}
if (this.needToChangeInnerWidth.includes(key)) {
if ((key === 'fontSize' || key === 'activeFontSize') && (this.terminal === 'mobile' || ['custom', 'v-text'].includes(component.type))) {
if ((key === 'fontSize' || key === 'activeFontSize') && (this.terminal === 'mobile' || ['custom'].includes(component.type))) {
// do nothing ( v-text )
} else {
component.style[key] = this.formatPoint(component.style[key], this.previewCanvasScale.scalePointWidth)
if (key === 'fontSize') {
component.style[key] = this.formatPoint(component.style[key], this.previewCanvasScale.scalePointWidth * 1.6)
} else {
component.style[key] = this.formatPoint(component.style[key], this.previewCanvasScale.scalePointWidth)
}
}
}
})