tk-eui-plus
Version:
2 lines (1 loc) • 1.02 kB
JavaScript
(function(e,l){typeof exports=="object"&&typeof module<"u"?module.exports=l(require("vue")):typeof define=="function"&&define.amd?define(["vue"],l):(e=typeof globalThis<"u"?globalThis:e||self,e.index=l(e.Vue))})(this,function(e){"use strict";const l=e.defineComponent({__name:"index",props:{title:{type:String,default:""},visible:Boolean},emits:["update:visible"],setup(n,{emit:r}){let o=n,a=e.useSlots(),f=r,i=e.ref(o.visible);return e.watch(()=>o.visible,t=>{i.value=t}),e.watch(()=>i.value,t=>{f("update:visible",t)}),(t,d)=>{const m=e.resolveComponent("el-drawer");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(m,e.mergeProps({modelValue:e.unref(i),"onUpdate:modelValue":d[0]||(d[0]=s=>e.isRef(i)?i.value=s:i=s),title:n.title},t.$attrs),{header:e.withCtx(()=>[e.renderSlot(t.$slots,"header")]),default:e.withCtx(()=>[e.unref(a).default?e.renderSlot(t.$slots,"default",{key:0}):e.createCommentVNode("v-if",!0)]),_:3},16,["modelValue","title"])])}}});return{install(n){n.component("tkDrawer",l)}}});