tyh-ui2
Version:
The next generation ui component library of tyh-ui is based on vue3 Version, fully embrace vue3.
2 lines (1 loc) • 1.32 kB
JavaScript
;Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("./index2.js"),u={class:"tyh-message-content"},p=e.defineComponent({name:"TyhMessage"}),d=e.defineComponent({...p,props:m.Props,setup(r){const s=r,o=e.ref(!0);let n;s.time>0&&(n=setTimeout(()=>{l()},s.time));const l=()=>{clearTimeout(n),o.value=!1},a=e.getCurrentInstance(),i=()=>{a.vnode.el.parentElement.removeChild(a.vnode.el)},c=e.computed(()=>["tyh-message",`tyh-message-${s.type}`,{"tyh-message-round":s.round}]);return(t,y)=>(e.openBlock(),e.createBlock(e.Transition,{name:"tyh-message-fade",appear:"",onAfterLeave:i},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(c)),style:e.normalizeStyle({top:`${t.offset}px`})},[e.createElementVNode("div",u,[t.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["tyh-icon","lef-icon",t.icon,`tyh-message-${t.type}`])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.message),1),t.showClose?(e.openBlock(),e.createElementBlock("i",{key:1,class:e.normalizeClass(["tyh-icon","tyh-ui-close",`tyh-message-${t.type}`]),onClick:l},null,2)):e.createCommentVNode("",!0)])],6),[[e.vShow,o.value]])]),_:1}))}});exports.default=d;