页面
<input #uploadImg class="d-none" type="file" (change)="imgCropper($event)">
ts
@ViewChild('uploadImg') uploadImg: any
imgCropper() {
// 一系列操作
// 最后把input的value置空
this.uploadImg.nativeElement.value = ''
}
页面
<input #uploadImg class="d-none" type="file" (change)="imgCropper($event)">
ts
@ViewChild('uploadImg') uploadImg: any
imgCropper() {
// 一系列操作
// 最后把input的value置空
this.uploadImg.nativeElement.value = ''
}