forked from Gitlink/forgeplus-react
文件列表message只显示第一行的内容
This commit is contained in:
parent
36e2f03946
commit
e1582102aa
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue