@lambo-design/pro-layout 1.0.0-beta.153 → 1.0.0-beta.155
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -63,10 +63,17 @@ export default {
|
|
|
63
63
|
const lines = this.systemInfo.nameSize; // 行数
|
|
64
64
|
const maxHeight = lineHeight * lines; // 计算最大高度
|
|
65
65
|
|
|
66
|
+
// 根据nameSize设置margin-top
|
|
67
|
+
if (lines === '1') {
|
|
68
|
+
style += `margin-top: 12px;`;
|
|
69
|
+
} else if (lines === '2') {
|
|
70
|
+
style += `margin-top: 5px; `;
|
|
71
|
+
}
|
|
72
|
+
|
|
66
73
|
// 动态计算字体大小
|
|
67
|
-
const fontSize = Math.max(20 - (lines - 1) *
|
|
74
|
+
const fontSize = Math.max(20 - (lines - 1) * 4, 15); // 字体大小递减
|
|
68
75
|
const lineHeight = fontSize + 5; // 固定行高
|
|
69
|
-
const width = (this.systemName.length/lines)*fontSize +
|
|
76
|
+
const width = (this.systemName.length / lines) * fontSize + 20;
|
|
70
77
|
|
|
71
78
|
// 组装样式字符串
|
|
72
79
|
style += `line-height: ${lineHeight}px;`;
|
|
@@ -76,8 +83,8 @@ export default {
|
|
|
76
83
|
style += `overflow: hidden;`; // 超出部分隐藏
|
|
77
84
|
style += `word-wrap: break-word;`; // 允许单词内换行
|
|
78
85
|
style += `white-space: normal;`; // 默认的换行方式
|
|
79
|
-
style += `text-align-last: justify
|
|
80
|
-
style += `text-align: justify
|
|
86
|
+
style += `text-align-last: justify;`;
|
|
87
|
+
style += `text-align: justify;`;
|
|
81
88
|
}
|
|
82
89
|
return style;
|
|
83
90
|
}
|