UNPKG

yk-element-components

Version:

101 lines (100 loc) 2.51 kB
import { defineComponent as b, ref as d, watch as c, resolveComponent as m, openBlock as g, createElementBlock as O, normalizeClass as h, createVNode as u, mergeProps as R, unref as f, isRef as B, withCtx as t, renderSlot as l } from "vue"; const C = /* @__PURE__ */ b({ __name: "index", props: { visible: { type: Boolean, default: !1 }, options: { type: Array, required: !0 }, isScroll: { type: Boolean, default: !1 }, onChange: { type: Function }, beforeUpload: { type: Function }, onPreview: { type: Function }, onRemove: { type: Function }, beforeRemove: { type: Function }, onSuccess: { type: Function }, onExceed: { type: Function } }, emits: ["update:visible"], setup(e, { emit: p }) { const i = e; let a = d(), n = d(i.visible); return c( () => i.visible, (o) => { n.value = o; } ), c( () => n.value, (o) => { p("update:visible", o); } ), (o, r) => { const v = m("yk-form"), y = m("el-dialog"); return g(), O("div", { class: h({ "m-choose-icon-dialog-body-height": e.isScroll }) }, [ u(y, R({ modelValue: f(n), "onUpdate:modelValue": r[0] || (r[0] = (s) => B(n) ? n.value = s : n = s) }, o.$attrs), { default: t(() => [ u(v, { ref_key: "form", ref: a, options: e.options, "label-width": "100px", onOnChange: e.onChange, onBeforeUpload: e.beforeUpload, onOnPreview: e.onPreview, onOnRemove: e.onRemove, onBeforeRemove: e.beforeRemove, onOnSuccess: e.onSuccess, onOnExceed: e.onExceed }, { uploadArea: t(() => [ l(o.$slots, "uploadArea") ]), uploadTip: t(() => [ l(o.$slots, "uploadTip") ]), _: 3 }, 8, ["options", "onOnChange", "onBeforeUpload", "onOnPreview", "onOnRemove", "onBeforeRemove", "onOnSuccess", "onOnExceed"]) ]), footer: t(() => [ l(o.$slots, "footer", { form: f(a) }) ]), _: 3 }, 16, ["modelValue"]) ], 2); }; } }), F = { install(e) { e.component("yk-modal-form", C); } }; export { F as default };