| 1 |
- import{_ as e}from"./u-icon.wXcRZHbn.js";import{o as t,t as l,p as o,w as s,v as c,B as i,R as r,Q as a,x as n,y as p,H as y,q as u,I as d}from"./index-P0fyQ2Em.js";import{r as f}from"./uni-app.es.DOtS5Ldl.js";import{_ as h}from"./_plugin-vue_export-helper.BCo6x5W8.js";const g=h({name:"u-alert-tips",emits:["click","close"],props:{title:{type:String,default:""},type:{type:String,default:"warning"},description:{type:String,default:""},closeAble:{type:Boolean,default:!1},closeText:{type:String,default:""},showIcon:{type:Boolean,default:!1},color:{type:String,default:""},bgColor:{type:String,default:""},borderColor:{type:String,default:""},show:{type:Boolean,default:!0},icon:{type:String,default:""},iconStyle:{type:Object,default:()=>({})},titleStyle:{type:Object,default:()=>({})},descStyle:{type:Object,default:()=>({})}},data:()=>({}),computed:{uTitleStyle(){let e={};return e.fontWeight=this.description?500:"normal",this.$u.deepMerge(e,this.titleStyle)},uIcon(){return this.icon?this.icon:this.$u.type2icon(this.type)},uIconType(){return Object.keys(this.iconStyle).length?"":this.type}},methods:{click(){this.$emit("click")},close(){this.$emit("close")}}},[["render",function(h,g,b,S,m,k){const w=f(t("u-icon"),e),x=u,_=d;return b.show?(l(),o(x,{key:0,class:y(["u-alert-tips",[b.show?"":"u-close-alert-tips",b.type?"u-alert-tips--bg--"+b.type+"-light":"",b.type?"u-alert-tips--border--"+b.type+"-disabled":""]]),style:a({backgroundColor:b.bgColor,borderColor:b.borderColor})},{default:s((()=>[c(x,{class:"u-icon-wrap"},{default:s((()=>[b.showIcon?(l(),o(w,{key:0,name:k.uIcon,size:b.description?40:32,class:"u-icon",color:k.uIconType,"custom-style":b.iconStyle},null,8,["name","size","color","custom-style"])):i("",!0)])),_:1}),c(x,{class:"u-alert-content",onClick:r(k.click,["stop"])},{default:s((()=>[c(x,{class:"u-alert-title",style:a([k.uTitleStyle])},{default:s((()=>[n(p(b.title),1)])),_:1},8,["style"]),b.description?(l(),o(x,{key:0,class:"u-alert-desc",style:a([b.descStyle])},{default:s((()=>[n(p(b.description),1)])),_:1},8,["style"])):i("",!0)])),_:1},8,["onClick"]),c(x,{class:"u-icon-wrap"},{default:s((()=>[b.closeAble&&!b.closeText?(l(),o(w,{key:0,onClick:k.close,hoverClass:"u-type-error-hover-color",name:"close",color:"#c0c4cc",size:22,class:"u-close-icon",style:a({top:b.description?"18rpx":"24rpx"})},null,8,["onClick","style"])):i("",!0)])),_:1}),b.closeAble&&b.closeText?(l(),o(_,{key:0,onClick:k.close,class:"u-close-text",style:a({top:b.description?"18rpx":"24rpx"})},{default:s((()=>[n(p(b.closeText),1)])),_:1},8,["onClick","style"])):i("",!0)])),_:1},8,["class","style"])):i("",!0)}],["__scopeId","data-v-1449fc7b"]]);const b=h({name:"jnpf-alert",props:{type:{type:String,default:"success"},title:{type:String,default:"这是一个提示"},tagIcon:{type:String,default:"icon-ym icon-ym-generator-alert"},showIcon:{type:Boolean,default:!1},closable:{type:Boolean,default:!1},description:{type:String,default:""},closeText:{type:String,default:""}},data:()=>({show:!0,titleStyle:{"word-break":"break-all","line-height":"34rpx"},descStyle:{"word-break":"break-all","line-height":"40rpx"}})},[["render",function(e,s,c,i,r,a){const n=f(t("u-alert-tips"),g);return l(),o(n,{class:"jnpf-alert",type:c.type,title:c.title,"show-icon":c.showIcon,description:c.description,"close-able":c.closable,"close-text":c.closeText,onClose:s[0]||(s[0]=e=>r.show=!1),show:r.show,"title-style":r.titleStyle,"desc-style":r.descStyle},null,8,["type","title","show-icon","description","close-able","close-text","show","title-style","desc-style"])}],["__scopeId","data-v-a70bf5d4"]]);export{b as _};
|