let self = this this.axios.put(this.uploadUrl, this.files[0], { headers: { 'Content-Type': 'multipart/form-data' }, transformRequest: [function (data) { return data }],
onDownloadProgress:
progressEvent => { let complete = (progressEvent.loaded / progressEvent.total * 100 | 0) + '%' self.uploadMessage = '上传 ' + complete },
onUploadProgress: progressEvent => { let complete = (progressEvent.loaded / progressEvent.total * 100 | 0) + '%' self.uploadMessage = '上传 ' + complete } }) .then((response) => { if (response.status === 200) { self.uploadMessage = '上传成功!' } })