diff --git a/src/renderer/views/lyric/index.vue b/src/renderer/views/lyric/index.vue index eab0d34..2b55d15 100644 --- a/src/renderer/views/lyric/index.vue +++ b/src/renderer/views/lyric/index.vue @@ -99,14 +99,15 @@
-
+ +
+ >  +
- {{ line.text || '' }}
+
@@ -142,6 +142,81 @@
无歌词
+ + +
+ +
无歌词
+
+ + +
+ +
无歌词
+
@@ -407,22 +482,13 @@ const wrapperStyle = computed(() => { }); // 新增:根据是否有翻译文本动态计算每行的样式 -const getDynamicLineStyle = (line: { text: string; trText: string }) => { - // 默认行高 +const getDynamicLineStyle = (line: { text: string; trText: string }, withTranslation = true) => { const defaultHeight = lineHeight.value; - - // 如果有翻译文本,增加额外高度 - if (line.trText) { - // 计算翻译文本的额外高度 (字体大小的0.6倍 * 行高比例1.4) + if (withTranslation && line.trText) { const extraHeight = Math.round(fontSize.value * 0.6 * 1.4); - return { - height: `${defaultHeight + extraHeight}px` - }; + return { height: `${defaultHeight + extraHeight}px` }; } - - return { - height: `${defaultHeight}px` - }; + return { height: `${defaultHeight}px` }; }; // 更新容器高度和行高 @@ -814,11 +880,7 @@ const validateAndFixColorSettings = () => { // 暴露函数 defineExpose({ resetThemeColor, - validateAndFixColorSettings, - // 以下供后续 Task(模板更新)使用,避免 noUnusedLocals 报错 - hasTranslation, - currentGroupLines, - isGroupTransitioning + validateAndFixColorSettings }); const updateCSSVariable = (name: string, value: string) => {