vue element upload 图片不及时更新

发布日期: 2021-01-26 00:00:00
点击次数: 907
大字 小字
解决方案: this.$forceUpdate()

this.uploadImg(formData)
        .then(res => {
          if (res.success == true) {
            if (index == 0) {
              this.ruleForm.idcardphoto1 = res.file
            else if (index == 1) {
              this.ruleForm.idcardphoto2 = res.file
            }
            this.$forceUpdate()
          else {
            this.$message.error(res.error)
          }
          // this.uploadLoading[index] = false
        })
        .catch(() => {
          //this.uploadLoading[index] = false
        })
返回顶部