Browse Source

style(ContentEditor): 将默认字体大小从30rpx调整为40rpx

统一修改文本组件的默认字体大小,提高可读性
master
主管理员 1 week ago
parent
commit
d36e48d78a
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      jeecgboot-vue3/src/views/applet/course-page/components/ContentEditor.vue

+ 5
- 5
jeecgboot-vue3/src/views/applet/course-page/components/ContentEditor.vue View File

@ -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`;
}


Loading…
Cancel
Save