开心一笑: 会买水果的狗狗

    关注微信公众号

    QQ群:831045818

    app下载

    当前位置:首页> React > 技术文档 > 正文
    react map方法传值
    发布时间:2019-12-04 15:30:13.0 浏览次数:
    //第一种 可以写this方法
    {this.state.user_album.map((val,key) => (
        <img src={val} style={{ width: '100%', verticalAlign: 'top' }}onLoad={this.getPicHeight(0,"hd_id",val)}/>
    ))}
    
    //第二种 可以写判断
    {this.state.couponList.map((v,k) => {
        return k < 5? <li><img src={v.avatar?(v.avatar.indexOf("http")==0?v.avatar:systemApi.getValue('imageUrl') + v.avatar+"?x-oss-process=image/resize,m_lfit,h_180,w_180,image/circle,r_50/format,png"):"images/activity_pic.jpg"} /></li>:""
    })}
    
    {this.state.couponList.map((v,k) => {
        if(k<5){
            return <li onClick={this.getItem}><img src={v.avatar?(v.avatar.indexOf("http")==0?v.avatar:systemApi.getValue('imageUrl') + v.avatar+"?x-oss-process=image/resize,m_lfit,h_180,w_180,image/circle,r_50/format,png"):"images/activity_pic.jpg"} /></li>
        }  
    })}


    关注"都市百货" 了解南陵

    微信咨询wanglf2r(不拉群 发广告者勿加)

    0
    0
    上一篇:南陵12月3日停水公告 上一篇:react 多元素重叠 解决点击激活多个 元素事件

    评论已有0

    提交评论

    热门评论

    南陵新闻
    公示公告
    常用查询
    风光南陵
    走出南陵
    友情链接