2 lines
1.3 KiB
JavaScript
2 lines
1.3 KiB
JavaScript
import{t as e,a as t,o as a,j as n,w as o,h as s,a0 as l,I as c,l as f,i as r,z as i,B as u}from"./index-9bec188e.js";import{P as p}from"./index.9b540af7.js";import{_ as d}from"./_plugin-vue_export-helper.1b428a4d.js";const m=d({__name:"index",props:{content:{type:String,default:()=>""},confirmText:{type:String,default:()=>"确认"},cancelText:{type:String,default:()=>"取消"},showCancel:{type:Boolean,default:()=>!0},showConfirm:{type:Boolean,default:()=>!0}},emits:["confirm","cancel"],setup(d,{expose:m,emit:_}){const x=d,{content:h,confirmText:y,cancelText:w,showCancel:C,showConfirm:k}=e(x),g=t();function b(){g.value.close()}function j(e="confirm"){_(e),b()}return m({show:function(){g.value.show()},close:b}),(e,t)=>{const d=u;return a(),n(p,{ref_key:"popupRef",ref:g,showCloseable:!1,mode:"center"},{default:o((()=>[s(d,{class:"modal-inner"},{default:o((()=>[s(d,{class:"content"},{default:o((()=>[l(e.$slots,"default",{},(()=>[c(f(r(h)),1)]),!0)])),_:3}),r(C)||r(k)?(a(),n(d,{key:0,class:"btn-group"},{default:o((()=>[r(C)?(a(),n(d,{key:0,class:"btn cancel",onClick:t[0]||(t[0]=e=>j("cancel"))},{default:o((()=>[c(f(r(w)),1)])),_:1})):i("",!0),r(k)?(a(),n(d,{key:1,class:"btn",onClick:t[1]||(t[1]=e=>j("confirm"))},{default:o((()=>[c(f(r(y)),1)])),_:1})):i("",!0)])),_:1})):i("",!0)])),_:3})])),_:3},512)}}},[["__scopeId","data-v-812e8fe5"]]);export{m as M};
|