Skip to content

Commit

Permalink
[修复] upload的input:file文件上传无法在低版本的chrome上监听ngModelChange fixes #710
Browse files Browse the repository at this point in the history
  • Loading branch information
hpyou authored and rdkmaster committed Aug 28, 2018
1 parent cca1da5 commit 426fbc0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/jigsaw/component/upload/upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
<span class="jigsaw-upload-icon fa fa-upload"></span>
<span class="jigsaw-upload-prompt">将文件拖拽到此处上传</span>
<j-button (click)="_$selectFile($event)">选择文件</j-button>
<input #fileInput class="jigsaw-upload-file-input" type='file' [multiple]="multiple"
[(ngModel)]="_$selectedFileChange">
<input #fileInput class="jigsaw-upload-file-input" type='file' [multiple]="multiple" (change)="_$selectedFileChange()">
</j-box>

<j-box *ngSwitchCase="'single'" type="flex" direction="v" justify="center" align="center" width="100%"
Expand Down
5 changes: 4 additions & 1 deletion src/jigsaw/component/upload/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ export class JigsawUpload extends AbstractJigsawComponent {
this._$uploadMode = files.length == 1 ? 'single' : 'multiple';
}

set _$selectedFileChange(value) {
/**
* @internal
*/
public _$selectedFileChange() {
this._$upload();
}

Expand Down

0 comments on commit 426fbc0

Please sign in to comment.