文件列表message只显示第一行的内容

This commit is contained in:
caishi 2022-05-23 18:30:03 +08:00
parent 36e2f03946
commit e1582102aa
1 changed files with 6 additions and 1 deletions

View File

@ -9,6 +9,11 @@ const typeIco = {
}
function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId , platform }){
//
function getMessage(value){
let str = value.indexOf('\n') > 0 && value.split('\n');
return str[0];
}
return(
<li>
<span>
@ -23,7 +28,7 @@ function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId , platform
</span>
<span title="init project">
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.commit && item.commit.sha}`)}`} title={item.commit && item.commit.message}>
{item.commit && item.commit.message}
{getMessage(item.commit && item.commit.message)}
</Link>
</span>
<span title={item.commit && item.commit.created_at}>{item.commit && item.commit.time_from_now}</span>