moreShopAdmin/build/admin/assets/vue-clipboard3.e775fc74.js

2 lines
463 B
JavaScript
Raw Permalink Normal View History

2024-11-21 16:02:32 +08:00
import{C as a}from"./clipboard.6417898a.js";const l=o=>{const r=(o==null?void 0:o.appendToBody)===void 0?!0:o.appendToBody;return{toClipboard(c,t){return new Promise((i,u)=>{const e=document.createElement("button"),d=new a(e,{text:()=>c,action:()=>"copy",container:t!==void 0?t:document.body});d.on("success",n=>{d.destroy(),i(n)}),d.on("error",n=>{d.destroy(),u(n)}),r&&document.body.appendChild(e),e.click(),r&&document.body.removeChild(e)})}}};export{l as u};