2 lines
2.0 KiB
JavaScript
2 lines
2.0 KiB
JavaScript
import{w as B,K as g}from"./element-plus.ab0703f2.js";import{d as k,r as C,n as b,I as S,o as s,c as f,a as T,J as m,W as w,ab as V,Q as a,U as d,V as r,P as y,T as u}from"./@vue.340249d8.js";import{d as $}from"./index.26dce67b.js";const E=k({props:{title:{type:String,default:""},content:{type:String,default:""},confirmButtonText:{type:[String,Boolean],default:"\u786E\u5B9A"},cancelButtonText:{type:[String,Boolean],default:"\u53D6\u6D88"},width:{type:String,default:"400px"},disabled:{type:Boolean,default:!1},async:{type:Boolean,default:!1},clickModalClose:{type:Boolean,default:!0},center:{type:Boolean,default:!1},showFooter:{type:Boolean,default:!0},customClass:{type:String,default:""}},emits:["confirm","cancel","close","open"],setup(e,{emit:o}){const t=C(!1),c=n=>{o(n),(!e.async||n==="cancel")&&i()},i=()=>{t.value=!1,b(()=>{o("close")})},p=()=>{e.disabled||(o("open"),t.value=!0)};return S("visible",t),{visible:t,handleEvent:c,close:i,open:p}}});const h={class:"dialog"},_={key:0,class:"dialog-footer"};function D(e,o,t,c,i,p){const n=B,v=g;return s(),f("div",h,[T("div",{class:"dialog__trigger",onClick:o[0]||(o[0]=(...l)=>e.open&&e.open(...l))},[m(e.$slots,"trigger",{},void 0,!0)]),w(v,{modelValue:e.visible,"onUpdate:modelValue":o[3]||(o[3]=l=>e.visible=l),"custom-class":e.customClass,center:e.center,"append-to-body":!0,width:e.width,"close-on-click-modal":e.clickModalClose,onClosed:e.close},V({footer:a(()=>[e.showFooter?(s(),f("div",_,[e.cancelButtonText?(s(),y(n,{key:0,onClick:o[1]||(o[1]=l=>e.handleEvent("cancel"))},{default:a(()=>[d(r(e.cancelButtonText),1)]),_:1})):u("",!0),e.confirmButtonText?(s(),y(n,{key:1,type:"primary",onClick:o[2]||(o[2]=l=>e.handleEvent("confirm"))},{default:a(()=>[d(r(e.confirmButtonText),1)]),_:1})):u("",!0)])):u("",!0)]),default:a(()=>[m(e.$slots,"default",{},()=>[d(r(e.content),1)],!0)]),_:2},[e.title?{name:"header",fn:a(()=>[d(r(e.title),1)]),key:"0"}:void 0]),1032,["modelValue","custom-class","center","width","close-on-click-modal","onClosed"])])}const I=$(E,[["render",D],["__scopeId","data-v-71eeedc7"]]);export{I as P};
|