1import{d as e,o,c as n,w as t,a,n as s,r as l,b as c,t as r,u as d,P as i,e as u,i as m,f as p,g as f,m as v,h as y,j as h,F as C,B as w,p as _,k as b}from"./index-54cfabc3.js";import{_ as g}from"./_plugin-vue_export-helper-1b428a4d.js";const k={class:"content"},O={class:"btn"},z=g(e({name:"BasicModal",props:{show:{type:Boolean,default:!1},closeOnClickOverlay:{type:Boolean,default:!1},size:{default:"large"}},emits:["confirm","update:show"],setup(e){const u=e;return(e,m)=>(o(),n(d(i),{show:u.show,onClose:m[2]||(m[2]=o=>e.$emit("update:show",!1)),teleport:"body",style:"overflow-y: auto;","close-on-click-overlay":e.closeOnClickOverlay},{default:t((()=>[a("div",{class:s(["modal-content",e.size])},[a("div",k,[l(e.$slots,"default",{},(()=>[c("å
容")]),!0)]),a("div",O,[a("div",{class:"btn-confirm",onClick:m[0]||(m[0]=o=>e.$emit("confirm"))},r(e.$t("btn.confirm")),1),a("div",{class:"btn-cancel",onClick:m[1]||(m[1]=o=>e.$emit("update:show",!1))},r(e.$t("btn.cancel")),1)])],2)])),_:3},8,["show","close-on-click-overlay"]))}}),[["__scopeId","data-v-ddabe61d"]]);const j=({renderComp:o,size:n})=>new Promise(((t,a)=>{let s;const l=e({setup(){const e=p(!0),o=o=>{e.value=o,o||(s&&s(),a("user closed modal manually"))};return{show:e,onChange:o,onConfirm:()=>{t("confirm"),o(!1)},size:n}},render(e){let n;return f(z,v({size:e.size,show:e.show},{"onUpdate:show":e.onChange},{onConfirm:e.onConfirm}),"function"==typeof(t=n=o())||"[object Object]"===Object.prototype.toString.call(t)&&!y(t)?n:{default:()=>[n]});var t}}),{unmount:c}=$(l);s=c})),$=e=>{const o=u(e);o.use(m);const n=document.createElement("div");document.body.appendChild(n);return{instance:o.mount(n),unmount(){o.unmount(),document.body.removeChild(n)}}},B=e=>(_("data-v-a875e876"),e=e(),b(),e),M=B((()=>a("span",{class:"title"},"vant",-1))),x={class:"demo"},P=B((()=>a("span",{class:"title"},"Modal",-1))),I={class:"demo"},D=g(e({...e({name:"DemoPage"}),setup(e){const n=()=>{j({renderComp:function(){return f("div",null,[c("èªå®ä¹å
容")])}}).then((e=>{console.log("确认æå",e)}))},s=()=>{j({size:"normal",renderComp:function(){return f("div",null,[c("èªå®ä¹å
容")])}}).then((e=>{console.log("确认æå",e)}))};return(e,l)=>{const r=w;return o(),h(C,null,[a("section",null,[M,a("div",x,[f(r,{type:"primary"},{default:t((()=>[c("ä¸»è¦æé®")])),_:1}),f(r,{type:"success"},{default:t((()=>[c("æåæé®")])),_:1}),f(r,{type:"default"},{default:t((()=>[c("é»è®¤æé®")])),_:1}),f(r,{type:"warning"},{default:t((()=>[c("è¦åæé®")])),_:1}),f(r,{type:"danger"},{default:t((()=>[c("å±é©æé®")])),_:1})])]),a("section",null,[P,a("div",I,[f(r,{type:"primary",onClick:n},{default:t((()=>[c("Open large Modal")])),_:1}),f(r,{onClick:s},{default:t((()=>[c("Open Normal Modal")])),_:1})])])],64)}}}),[["__scopeId","data-v-a875e876"]]);export{D as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.