Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么修改state没效果?rate #48

Open
q1457797371 opened this issue Aug 16, 2017 · 0 comments
Open

为什么修改state没效果?rate #48

q1457797371 opened this issue Aug 16, 2017 · 0 comments

Comments

@q1457797371
Copy link

q1457797371 commented Aug 16, 2017

`
render() {
console.log(this);
console.log("===");

return (

  <div className="page2-page">
    <PageHead title="导入历史订单" description="xxxx。"/>
    <Tab defaultActiveKey="taobao-import" onChange={this.handleChange}>
      {
        tabs.map(item => <TabPane key={item.key} tab={item.tab}
                                  onClick={this.handleClick}></TabPane>)
      }
    </Tab>
    <DownLoadItem/>
    <div className="title">
      第二步: 上传历史订单
    </div>
    <div className="content">
      <FileUpload options={this.uploadOptions}>
        <p>You have uploaded {this.state.rate}</p>
        <Button ref="chooseAndUpload" type="primary">选中文件</Button>
      </FileUpload>

    </div>
  
  </div>
);

}
`
为什么当上传的时候,this.state.rate没有值?不会变化为什么?

uploading: function (progress) {
console.log(this)
let rate = progress.loaded / progress.total + '%';
this.setState({rate})
console.log('loading...', rate)
message.error(Upload failed,)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant