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.97 kB
JavaScript
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("./index2.js"),p=["onClick"],u={key:0,class:"tyh-dialog-header"},m={key:0,class:"tyh-dialog-title"},h={key:1,class:"tyh-dialog-title"},y=["onClick"],k={key:1,class:"tyh-dialog-body"},f={key:2,class:"tyh-dialog-footer"},C=e.defineComponent({name:"TyhDialog"}),g=e.defineComponent({...C,props:c.Props,emits:["update:modelValue","open","close","onOpen","onClose"],setup(a,{emit:l}){const n=a,s=()=>{l("close"),l("update:modelValue",!1)},i=()=>{!n.modalClose||s()},{proxy:d}=e.getCurrentInstance();return e.watch(()=>n.modelValue,o=>{o&&l("open");const t=d.$el;o&&n.appendToBody&&document.body.appendChild(t)}),(o,t)=>(e.openBlock(),e.createBlock(e.Transition,{name:"tyh-dialog",onAfterEnter:t[0]||(t[0]=r=>l("onOpen")),onAfterLeave:t[1]||(t[1]=r=>l("onClose"))},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["tyh-dialog-packing",{"tyh-dialog-modal":o.modal}]),style:e.normalizeStyle({zIndex:o.zIndex}),onClick:e.withModifiers(i,["self"])},[e.createElementVNode("div",{class:"tyh-dialog",style:e.normalizeStyle({width:o.width,marginTop:o.top})},[o.showHeader?(e.openBlock(),e.createElementBlock("div",u,[o.$slots.title?(e.openBlock(),e.createElementBlock("span",m,[e.renderSlot(o.$slots,"title")])):(e.openBlock(),e.createElementBlock("span",h,e.toDisplayString(o.title),1)),o.showClose?(e.openBlock(),e.createElementBlock("i",{key:2,class:"tyh-icon tyh-ui-close",onClick:e.withModifiers(s,["stop"])},null,8,y)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),o.$slots.default?(e.openBlock(),e.createElementBlock("div",k,[e.renderSlot(o.$slots,"default")])):e.createCommentVNode("",!0),o.$slots.footer?(e.openBlock(),e.createElementBlock("div",f,[e.renderSlot(o.$slots,"footer")])):e.createCommentVNode("",!0)],4)],14,p),[[e.vShow,o.modelValue]])]),_:3}))}});exports.default=g;