美文网首页web全栈vue前端、uniapp和element ui
vue + element 项目中,多文件上传,如果上传之前做判

vue + element 项目中,多文件上传,如果上传之前做判

作者: 忘川之曼殊沙华 | 来源:发表于2021-06-07 11:24 被阅读0次

使用延时加同步方法解决

beforeupload(file) {
      console.log(file)
      const that = this
      setTimeout(async() => {
        await that.$message({ type: 'success', message: file.name })
        //  Message({
        //   message: file.name,
        //   type: 'error'
        // })
      })

      // 重点是  setTimeout  async  await 

      // this.$message({ type: 'success', message: file.name })
    }

相关文章

网友评论

    本文标题:vue + element 项目中,多文件上传,如果上传之前做判

    本文链接:https://www.haomeiwen.com/subject/mkkleltx.html