87,993
社区成员
发帖
与我相关
我的任务
分享
<FormItem>
<input type="file" id="uploadIcon" accept="image/*" @change="uploadImg($event)" ref="uploadIcon">
</FormItem>
<FormItem label="图片存放路径" prop="iconPath">
<Input v-model="bannerForm.iconPath" disabled/>
</FormItem>
uploadImg (e) {
let file = e.target.files[0];
let reader = new FileReader();
let that = this;
reader.readAsDataURL(file)
reader.onload = function(e) {
that.uploadIcon = this.result
}
},