vue使用二进制流下载文件,使用

 link.href = window.URL.createObjectURL(blob);

报错:
Failed to execute ‘createObjectURL’ on ‘URL’: Overload resolution failed.
百度了下,是因为Chrome更新后不支持这种用法,需要改为:

  let binaryData = [];
                    binaryData.push(blob);
                    link.href = window.URL.createObjectURL(new Blob(binaryData));
Logo

基于 Vue 的企业级 UI 组件库和中后台系统解决方案,为数万开发者服务。

更多推荐