From d36e48d78a8afe6ded4b4f6d31d7183e374f65d3 Mon Sep 17 00:00:00 2001 From: lzx_win <2602107437@qq.com> Date: Mon, 20 Oct 2025 11:27:55 +0800 Subject: [PATCH] =?UTF-8?q?style(ContentEditor):=20=E5=B0=86=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=AD=97=E4=BD=93=E5=A4=A7=E5=B0=8F=E4=BB=8E30rpx?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=BA40rpx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 统一修改文本组件的默认字体大小,提高可读性 --- .../src/views/applet/course-page/components/ContentEditor.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jeecgboot-vue3/src/views/applet/course-page/components/ContentEditor.vue b/jeecgboot-vue3/src/views/applet/course-page/components/ContentEditor.vue index b025405..754a3e3 100644 --- a/jeecgboot-vue3/src/views/applet/course-page/components/ContentEditor.vue +++ b/jeecgboot-vue3/src/views/applet/course-page/components/ContentEditor.vue @@ -176,7 +176,7 @@ watch( componentsRef.value = cloned.map((c: any) => { if (c?.type === 'text') { if (!c.style) c.style = {}; - if (!c.style.fontSize) c.style.fontSize = '30rpx'; + if (!c.style.fontSize) c.style.fontSize = '40rpx'; if (!c.style.color) c.style.color = '#333333'; if (!c.style.fontFamily) c.style.fontFamily = 'SimSun'; if (!c.style.fontWeight) c.style.fontWeight = 'normal'; @@ -208,7 +208,7 @@ function addTextContent() { content: '', language: 'zh', style: { - fontSize: '30rpx', + fontSize: '40rpx', color: '#333333', fontFamily: 'SimSun', }, @@ -272,9 +272,9 @@ function ensureStyle(component: any) { function getFontSizeNumber(component: any) { const s = component.style?.fontSize; - if (!s) return 30; + if (!s) return 40; const m = typeof s === 'string' ? s.match(/(\d+)/) : null; - return m ? Number(m[1]) : 30; + return m ? Number(m[1]) : 40; } function setFontSizeNumber(component: any, value: number) { @@ -282,7 +282,7 @@ function setFontSizeNumber(component: any, value: number) { // 确保value是有效数字,然后统一以 rpx 保存 const numValue = Number(value); if (isNaN(numValue) || numValue <= 0) { - component.style.fontSize = '30rpx'; // 默认值 + component.style.fontSize = '40rpx'; // 默认值 } else { component.style.fontSize = `${numValue}rpx`; }