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

kl-upload非立即上传模式下的formData数据错误 #328

Open
smallcosmos opened this issue Mar 12, 2018 · 1 comment
Open

kl-upload非立即上传模式下的formData数据错误 #328

smallcosmos opened this issue Mar 12, 2018 · 1 comment
Assignees
Labels

Comments

@smallcosmos
Copy link
Contributor

No description provided.

@smallcosmos
Copy link
Contributor Author

复现:

配置autoUpload属性为false,初始化formData,选择文件后点击上传,查看请求中formData数据

### html
<kl-upload file-list={list} autoUpload={false} formData={formData}></kl-upload>
<kl-button title="上传" on-click={this.upload()}></kl-button>

### js
upload: function(){
  var ajax = new XMLHttpRequest();
  ajax.open('json', '/upload');
  ajax.send(this.data.formData); 
 }

原因:

#322 修复引入,#322修复中,在选择文件之后对FileList同步以后赋值操作延后,导致initFormData中没有取到fileList,进而导致formData数据有误

修复:

initFormData接口调用前,对fileList进行数据同步。

@smallcosmos smallcosmos self-assigned this Mar 12, 2018
@smallcosmos smallcosmos changed the title kl-upload kl-upload非立即上传模式下的formData数据错误 Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant