UNPKG

vuux

Version:

Vue3 Nuxt3 Nuxt4 组件库

2 lines (1 loc) 1.89 kB
"use strict";const e=require("vue"),p=require("./hook/useAlert.cjs"),t=require("@vuux/icons"),u={class:"alert-content"},d={class:"content-title"},k={key:0,class:"content-description"},y=e.defineComponent({name:"Alert",__name:"index",props:{type:{default:"info"},title:{},description:{},showIcon:{type:Boolean},showClose:{type:Boolean}},emits:["close"],setup(c,{emit:l}){const o=c,a=l,{isShow:i,iconSize:n,hanleClose:r}=p.useAlert(o,a);return(B,s)=>e.unref(i)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["app-alert",`is-${o.type}`])},[c.showIcon?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.type==="success"?(e.openBlock(),e.createBlock(e.unref(t.Icon),{key:0,name:"Icon5524835",size:e.unref(n),color:"var(--app-success)"},null,8,["size"])):e.createCommentVNode("",!0),o.type==="info"?(e.openBlock(),e.createBlock(e.unref(t.Icon),{key:1,name:"Icon4835048",size:e.unref(n),color:"var(--app-primary)"},null,8,["size"])):e.createCommentVNode("",!0),o.type==="error"?(e.openBlock(),e.createBlock(e.unref(t.Icon),{key:2,name:"Icon5212574",size:e.unref(n),color:"var(--app-danger)"},null,8,["size"])):e.createCommentVNode("",!0),o.type==="warning"?(e.openBlock(),e.createBlock(e.unref(t.Icon),{key:3,name:"Icon7903790",size:e.unref(n),color:"var(--app-warning)"},null,8,["size"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.createElementVNode("div",u,[e.createElementVNode("div",d,e.toDisplayString(o.title),1),o.description?(e.openBlock(),e.createElementBlock("div",k,e.toDisplayString(o.description),1)):e.createCommentVNode("",!0)]),c.showClose?(e.openBlock(),e.createElementBlock("div",{key:1,class:"alert-close",onClick:s[0]||(s[0]=(...m)=>e.unref(r)&&e.unref(r)(...m))},[e.createVNode(e.unref(t.Icon),{name:"Icon9176904",size:12,opacity:.8})])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)}});module.exports=y;