<el-form ref="form" :model="form" :rules="rules" size="small" label-width="90px">
<el-upload
class="avatar-uploader"
action='http://192.168.1.143:8090/consulting-file/file/tempSaveFile'
name="multipartFile"
:show-file-list="false"
v-model="form.file.fileId"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="imageUrl" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
``` doSubmit() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.loading = true
/* this.form.roles = [] */
const _this = this
commit(this.form.file.fileId).then(res => {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500,
})
this.loading = false
this.$parent.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
/* this.roleIds.forEach(function(data, index) {
const role = { id: data }
_this.form.roles.push(role)
}) */
/* this.form.accountNumber.password = md5(this.form.accountNumber.password) */
} else {
return false
}
})
},
上传图片完成时 下次上传上次的图片还会显示出来 怎么清空
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
4条回答 默认 最新
- Houmior 2019-01-24 13:42关注
在dosubmit()里写一个imgurl=''就可以了
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
- ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
- ¥20 有关区间dp的问题求解
- ¥15 多电路系统共用电源的串扰问题
- ¥15 slam rangenet++配置
- ¥15 有没有研究水声通信方面的帮我改俩matlab代码
- ¥15 ubuntu子系统密码忘记
- ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
- ¥15 保护模式-系统加载-段寄存器
- ¥15 电脑桌面设定一个区域禁止鼠标操作