mirror of
https://github.com/501351981/vue-office.git
synced 2025-07-15 07:32:19 +08:00
2 lines
649 B
JavaScript
2 lines
649 B
JavaScript
function i(e){return typeof e=="string"?e:e instanceof Blob?URL.createObjectURL(e):e instanceof ArrayBuffer?URL.createObjectURL(new Blob([e])):e instanceof Response?URL.createObjectURL(e.blob()):e}function l(e){return new Promise((n,t)=>{let o=document.createElement("script");o.src=e,o.onload=function(){n()},o.onerror=function(){t()},document.body.append(o)})}async function c(e,n){n&&(n instanceof ArrayBuffer&&(n=new Blob([n])),r(e,URL.createObjectURL(n)))}function r(e,n){let t=document.createElement("a");t.download=e,t.style.display="none",t.href=n,document.body.appendChild(t),t.click(),document.body.removeChild(t)}export{c as d,i as g,l};
|