账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    react里面怎么if else都跑了一遍?
    25
    0

    在练习react的时候,我写了这么一段代码,为什么if else都走了呢

    import React from 'react'
    
    class Detail extends React.Component {
        render() {
            const loginstate=this.props.logininfo.islogin
            if(loginstate=='no'){
              return (
                  <div></div>
              )
            }
            else{
              return (
                  <div>
                    <p>姓名:{ this.props.loginlist.userid}</p>
                    <p>城市:{ this.props.loginlist.city}</p>
                  </div>
              )
            }
    
        }
    }
    
    
    
    export default Detail
    
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 战国策 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部