iview上传图片
<Upload ref="upload"
:format="['jpg','jpeg','png']"
action="http://10.0.0.4:8004/uploadPic"
:headers="{ Authorization: token}"
:data= "uploadparameter"
:with-credentials=true
:name="file"
:on-progress = "onprogress">
<Button type="ghost" icon="ios-cloud-upload-outline">上传 </Button>
</Upload>
token: cookie.get('token'),
uploadparameter: { fileUrl: '' },
upload: {
fileUrl: '',
file: '',
},
onprogress(event, file) {
this.upload.file = file.uid;
},
重置上传图片
handleReset(name) {
this.$refs[name].resetFields();
this.$refs.upload.clearFiles();
},