Commit dd0abdee by 姜雷

修复单图图片显示问题

parent 1308c934
...@@ -43,24 +43,19 @@ class Perview extends Component { ...@@ -43,24 +43,19 @@ class Perview extends Component {
afterChange={this.onChangeHandle} afterChange={this.onChangeHandle}
> >
{list.length === 1 ? ( {list.length === 1 ? (
<div> <div className={styles.carouselImg}>
<img <img src={list[0].url || list[0]} alt="" />
className={styles.carouselImg}
src={list[0].url || list[0]}
alt=""
/>
</div> </div>
) : ( ) : (
list.map( list.map((item, index) =>
(item, index) => item ? (
item ? ( <img
<img className={styles.carouselImg}
className={styles.carouselImg} key={index}
key={index} src={item.url || item}
src={item.url || item} alt=""
alt="" />
/> ) : null
) : null
) )
)} )}
</Carousel> </Carousel>
......
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