vue element upload 图片不及时更新

2021-01-26 00:00:00 by 【6yang】, 993 visits, 收藏 | 返回
解决方案: 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
        })
分享到:
share

    图片原图

    loading

    loading