import{a as A,d as m,b as r,c as V}from"./download-CIBdrxiA.js";import{d as D,h as S,o as f,i as F,j as l,w as t,p as e,W as N,al as U,B as W,G as g}from"./index-9PRMimni.js";import"./base64Conver-4Xd-Hzyx.js";const q="data:image/png;base64,[encoded data, 8600 characters]",R={class:"n-layout-page-header"},J=D({__name:"download",setup(w){const a=new Date().valueOf();function c(){A("测试下载文件流",`${a}-file.txt`)}function s(){m({url:"https://naive-ui-admin-docs.vercel.app/logo.png",target:"_self"})}function u(){r(q,`${a}.png`)}function y(){V("https://naive-ui-admin-docs.vercel.app/logo.png",`${a}.png`)}return(v,n)=>{const p=N,o=W,i=U,d=g;return f(),S("div",null,[F("div",R,[l(p,{bordered:!1,title:"文件下载"},{default:t(()=>n[0]||(n[0]=[e(" 文件下载示例，用于各种场景下载文件或者图片 ")])),_:1})]),l(p,{bordered:!1,class:"mt-3 proCard"},{default:t(()=>[l(i,{"show-icon":!1,title:"后台接口文件流下载",type:"info"},{default:t(()=>[l(o,{class:"mt-2",type:"primary",onClick:c},{default:t(()=>n[1]||(n[1]=[e("文件流下载")])),_:1})]),_:1}),l(d),l(i,{"show-icon":!1,title:"文件地址下载",type:"info"},{default:t(()=>[l(o,{class:"mt-2",type:"primary",onClick:s},{default:t(()=>n[2]||(n[2]=[e("文件地址下载")])),_:1})]),_:1}),l(d),l(i,{"show-icon":!1,title:"base64流下载",type:"info"},{default:t(()=>[l(o,{class:"mt-2",type:"primary",onClick:u},{default:t(()=>n[3]||(n[3]=[e("base64流下载")])),_:1})]),_:1}),l(d),l(i,{"show-icon":!1,title:"图片Url下载，如果有跨域问题，需要先处理图片跨域，才能下载",type:"info"},{default:t(()=>[l(o,{class:"mt-2",type:"primary",onClick:y},{default:t(()=>n[4]||(n[4]=[e("图片Url下载")])),_:1})]),_:1})]),_:1})])}}});export{J as default};
