File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -471,7 +471,7 @@ function App() {
471471 < div className = "w-full max-w-xs sm:max-w-sm text-center mb-6 sm:mb-8 px-2" >
472472 < div
473473 ref = { lyricsContainerRef }
474- className = "rounded-lg p-3 sm:p-4 max-h-60 sm:max-h-478 overflow-y-auto custom-scrollbar"
474+ className = "rounded-lg p-3 sm:p-4 max-h-60 sm:max-h-80 overflow-y-auto custom-scrollbar"
475475 style = { {
476476 scrollBehavior : 'auto' ,
477477 scrollbarWidth : 'none' ,
@@ -482,9 +482,13 @@ function App() {
482482 { /* 顶部空白区域 */ }
483483 < div className = "h-16 sm:h-24" > </ div >
484484 < div className = "text-gray-400 text-xs sm:text-sm" >
485- { musicInfo . lyrics ?. split ( '\\n' ) . map ( ( line , index ) => (
486- < div key = { index } > { line } </ div >
487- ) ) }
485+ { typeof musicInfo . lyrics === 'string' ? (
486+ musicInfo . lyrics . split ( '\n' ) . map ( ( line : string , index : number ) => (
487+ < div key = { index } className = "mb-1" > { line } </ div >
488+ ) )
489+ ) : (
490+ < div > 暂无歌词</ div >
491+ ) }
488492 </ div >
489493 { /* 滚动播放歌词 */ }
490494 { /* {lyricArr.length > 0 ?
You can’t perform that action at this time.
0 commit comments