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

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

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    react工程里点击事件没效果,控制台里也没有报错
    26
    0

    代码地址

    没效果的代码

    export default class User extends Component {
      logout() {
        console.log(1)
            const alert = Modal.alert
            alert('注销', '确认退出登录吗???', [
                  { text: '取消', onPress: () => console.log('cancel') },
                  { text: '确认', onPress: () => {
                      browserCookie.erase('userid')
                      this.props.logoutSubmit()
                  }}
                ])
      }
      render() {
            const props = this.props
            const Item = List.Item
            const Brief = Item.Brief    
        return props.user ? (
          <div>
            <Result
              img={<img src={require(`../img/${props.avatar}.png`)} tyle={{ width: 50 }} alt="" />}
              title={props.user}
              message={props.type === 'boss' ? props.company : null}
            />
                    <List renderHeader={()=>'简介'}>
                <Item multipleLine>
                  {props.title}
                  {props.desc.split('\n').map(v=><Brief key={v}>{v}</Brief>)}
                  {props.money?<Brief>薪资:{props.money}</Brief>:null}
                </Item>          
            </List>
                    <WhiteSpace></WhiteSpace>
                    <List>
              <Item onClick={() => this.logout()}>退出登录</Item>
            </List>  
          </div>
        ) : <Redirect to={props.redirectTo} />
      }
    }

    很奇怪的问题,也不知道是什么原因,现在就算在其他文件里加点击事件也不起作用,控制台既不打印,也不报错

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 狐狸 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


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