skin-fly-ui
Version:
skin-fly-ui功能完善中...,
2 lines (1 loc) • 1.32 kB
JavaScript
;const e=require("vue"),o={class:"text"};const r=((e,o)=>{const r=e.__vccOpts||e;for(const[t,n]of o)r[t]=n;return r})({name:"FlyMessage",props:{type:{type:String,default:"success"},str:{type:String,default:"成功"}},setup(){const o=e.ref(!1);return e.onMounted((()=>{o.value=!0})),{style:{warn:{icon:"icon-warning",color:"#E6A23C",backgroundColor:"rgb(253, 246, 236)",borderColor:"rgb(250, 236, 216)"},error:{icon:"icon-shanchu",color:"#F56C6C",backgroundColor:"rgb(254, 240, 240)",borderColor:"rgb(253, 226, 226)"},success:{icon:"icon-queren2",color:"#67C23A",backgroundColor:"rgb(240, 249, 235)",borderColor:"rgb(225, 243, 216)"},info:{icon:"",color:"",backgroundColor:"",borderColor:""}},visible:o}}},[["render",function(r,t,n,c,l,s){return e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"pop-message",style:e.normalizeStyle(c.style[n.type])},[e.createElementVNode("i",{class:e.normalizeClass(["icon",[c.style[n.type].icon]])},null,2),e.createElementVNode("span",o,e.toDisplayString(n.str),1)],4)),[[e.vShow,c.visible]])}],["__scopeId","data-v-bd56ea0e"]]),t=document.createElement("div");document.body.appendChild(t);let n=null;module.exports=({str:o,type:c})=>{const l=e.createVNode(r,{str:o,type:c});e.render(l,t),n&&clearTimeout(n),n=setTimeout((()=>{e.render(null,t)}),2e3)};