首页 > 解决方案 > TypeError:无法读取未定义的属性“url0”

问题描述

在此处输入图像描述当我运行代码时,它工作正常并且图像正在显示,但一段时间后我收到此错误。

<Card hoverable
           style={{ width:240 ,padding:3}}
          onClick={()=>this.moveToDest(item)}
          pose={this.state.hovering ? "hovered" : "idle"}
          onMouseEnter={() => this.setState({ hovering: true })}
          onMouseLeave={() => this.setState({ hovering: false })}

          //  src={'http://192.168.0.103:5001/'+item.images.filename}
          cover={<img  alt="example" src={item.images.url0} style={{height:'180px'}} />}
          ><Card.Meta title={item.name} description={item.country} /></Card>
      </List.Item>
    )}
  />

图像将显示在卡片中

标签: reactjs

解决方案


推荐阅读