l-element-components
Version:
2 lines (1 loc) • 1.66 kB
JavaScript
(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("vue")):typeof define=="function"&&define.amd?define(["vue"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.index=i(e.Vue))})(this,function(e){"use strict";const i=e.defineComponent({__name:"index",props:{visible:{type:Boolean,default:!1},options:{type:Array,required:!0},onPreview:{type:Function},onChange:{type:Function},onRemove:{type:Function},beforeRemove:{type:Function},onExceed:{type:Function},onSuccess:{type:Function}},emits:["update:visible"],setup(o,{emit:a}){let l=o,f=a,r=e.ref(null),t=e.ref(l.visible);return e.watch(()=>l.visible,n=>{t.value=n}),e.watch(()=>t.value,n=>{f("update:visible",n)}),(n,s)=>{const c=e.resolveComponent("l-form"),m=e.resolveComponent("el-scrollbar"),p=e.resolveComponent("el-dialog");return e.openBlock(),e.createBlock(p,e.mergeProps({modelValue:e.unref(t),"onUpdate:modelValue":s[0]||(s[0]=d=>e.isRef(t)?t.value=d:t=d)},n.$attrs),{footer:e.withCtx(()=>[e.renderSlot(n.$slots,"footer",{form:e.unref(r)})]),default:e.withCtx(()=>[e.createVNode(m,{height:"450px"},{default:e.withCtx(()=>[e.createVNode(c,{ref_key:"form",ref:r,options:o.options,onOnPreview:o.onPreview,onOnRemove:o.onRemove,onBeforeRemove:o.beforeRemove,onOnExceed:o.onExceed,onOnSuccess:o.onSuccess,onOnChange:o.onChange,"label-width":"100px"},{uploadArea:e.withCtx(()=>[e.renderSlot(n.$slots,"uploadArea")]),uploadTip:e.withCtx(()=>[e.renderSlot(n.$slots,"uploadTip")]),_:3},8,["options","onOnPreview","onOnRemove","onBeforeRemove","onOnExceed","onOnSuccess","onOnChange"])]),_:3})]),_:3},16,["modelValue"])}}});return{install(o){o.component("l-modal-form",i)}}});