Commit 2cd330cd authored by wty's avatar wty

修改默认图标为首字

parent 29e32d80
...@@ -37,7 +37,13 @@ function ContentItem(props) { ...@@ -37,7 +37,13 @@ function ContentItem(props) {
return ( return (
<div className="content-item"> <div className="content-item">
<div className="item-icon" onClick={() => jumpUrl(toolBoxUrl)}> <div className="item-icon" onClick={() => jumpUrl(toolBoxUrl)}>
<img src={itemIcon} alt='' onError={(e) => setItemIcon('noImg')}/> {
!itemIcon && <div className="defaultIcon">{toolBoxName[0]}</div>
}
{
itemIcon && <img src={itemIcon} alt='' onError={e => setItemIcon(null)}/>
}
</div> </div>
<div className="item-name" onClick={() => jumpUrl(toolBoxUrl)}>{toolBoxName}</div> <div className="item-name" onClick={() => jumpUrl(toolBoxUrl)}>{toolBoxName}</div>
<div className="item-desc">{toolBoxDesc}</div> <div className="item-desc">{toolBoxDesc}</div>
......
...@@ -51,6 +51,15 @@ ...@@ -51,6 +51,15 @@
position: relative; position: relative;
cursor: pointer; cursor: pointer;
.defaultIcon{
width: 100%;
height: 100%;
font-size: 30px;
font-weight: bold;
line-height: 65px;
text-align: center;
}
img{ img{
width: 100%; width: 100%;
height: 100%; height: 100%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment