mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-01-04 04:08:13 +00:00
2 lines
2.2 KiB
JavaScript
2 lines
2.2 KiB
JavaScript
import{v as $,T as I}from"./error-492b6a5b.js";import{T,E as g,c as V}from"./index-868cd458.js";import{b as A,k as D,u as P,_ as F,w as M}from"./plugin-vue_export-helper-edbdb6f8.js";import{d as S,G as q,r as z,c as p,b as o,m as n,p as d,L as G,f as k,n as a,u as e,U as O,C as i,e as r,g as b,v as C,x as f,F as U,q as _}from"./runtime-core.esm-bundler-7c3fd514.js";import{v as h,L as E}from"./directive-a07a10ed.js";const j=["light","dark"],H=A({title:{type:String,default:""},description:{type:String,default:""},type:{type:String,values:D(T),default:"info"},closable:{type:Boolean,default:!0},closeText:{type:String,default:""},showIcon:Boolean,center:Boolean,effect:{type:String,values:j,default:"light"}}),J={close:l=>l instanceof MouseEvent},K=S({name:"ElAlert"}),Q=S({...K,props:H,emits:J,setup(l,{emit:w}){const c=l,{Close:B}=V,u=q(),t=P("alert"),m=z(!0),v=p(()=>T[c.type]),L=p(()=>[t.e("icon"),{[t.is("big")]:!!c.description||!!u.default}]),N=p(()=>({[t.is("bold")]:c.description||u.default})),y=s=>{m.value=!1,w("close",s)};return(s,W)=>(o(),n(I,{name:e(t).b("fade"),persisted:""},{default:d(()=>[G(k("div",{class:a([e(t).b(),e(t).m(s.type),e(t).is("center",s.center),e(t).is(s.effect)]),role:"alert"},[s.showIcon&&e(v)?(o(),n(e(g),{key:0,class:a(e(L))},{default:d(()=>[(o(),n(O(e(v))))]),_:1},8,["class"])):i("v-if",!0),k("div",{class:a(e(t).e("content"))},[s.title||s.$slots.title?(o(),r("span",{key:0,class:a([e(t).e("title"),e(N)])},[b(s.$slots,"title",{},()=>[C(f(s.title),1)])],2)):i("v-if",!0),s.$slots.default||s.description?(o(),r("p",{key:1,class:a(e(t).e("description"))},[b(s.$slots,"default",{},()=>[C(f(s.description),1)])],2)):i("v-if",!0),s.closable?(o(),r(U,{key:2},[s.closeText?(o(),r("div",{key:0,class:a([e(t).e("close-btn"),e(t).is("customed")]),onClick:y},f(s.closeText),3)):(o(),n(e(g),{key:1,class:a(e(t).e("close-btn")),onClick:y},{default:d(()=>[_(e(B))]),_:1},8,["class"]))],64)):i("v-if",!0)],2)],2),[[$,m.value]])]),_:3},8,["name"]))}});var R=F(Q,[["__file","/home/runner/work/element-plus/element-plus/packages/components/alert/src/alert.vue"]]);const se=M(R),te={install(l){l.directive("loading",h),l.config.globalProperties.$loading=E},directive:h,service:E};export{se as E,te as a};
|