• 2
  • 新人请关照

vue中使用plupload组件报错及不支持UploadProgress进度的问题

问题:
在普通html中使用plupload2.1.2版本
上传一切正常,可是在 vue中通过npm install安装的plupload最新版2.3.6

plupload.full.min.js?16ea:15 Uncaught TypeError: m.upload.addEventListener is not a function
    at n.send (plupload.full.min.js?16ea:15)
    at n.exec (plupload.full.min.js?16ea:13)
    at n.shimExec (plupload.full.min.js?16ea:13)
    at n.exec (plupload.full.min.js?16ea:13)
    at r (plupload.full.min.js?16ea:14)
    at h.u (plupload.full.min.js?16ea:14)
    at h.send (plupload.full.min.js?16ea:14)
    at s (plupload.full.min.js?16ea:29)
    at l.Uploader.E (plupload.full.min.js?16ea:29)
    at l.Uploader.dispatchEvent (plupload.full.min.js?16ea:29)

目前的做法是找到plupload.full.min.js将m.upload.addEventListener改为m.addEventListener后能正常编译可上传,也能正常成功上传到服务器,但无论如何UploadProgress进度只有上传成功后才返回一个100,请大神帮忙看看如何解决,谢谢

...
UploadProgress: function(up, file) {
    var percent = file.percent;
    console.log(file.percent); //百分比显示,
},
...
阅读 4.1k
评论
    2 个回答
    • 2
    • 新人请关照
      • 29
        撰写回答

        登录后参与交流、获取后续更新提醒