Houmior 2019-01-22 11:24 采纳率: 0%
浏览 2725
已采纳

上传图片完成时 下次上传上次的图片还会显示出来 怎么清空

 <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
        }
      })
    },
  • 写回答

4条回答

  • Houmior 2019-01-24 13:42
    关注

    在dosubmit()里写一个imgurl=''就可以了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 slam rangenet++配置
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊