l-element-components
Version:
92 lines (91 loc) • 2.43 kB
JavaScript
import { defineComponent as g, ref as m, watch as c, resolveComponent as l, createBlock as R, openBlock as h, mergeProps as w, unref as d, isRef as x, withCtx as t, createVNode as f, renderSlot as i } from "vue";
const C = /* @__PURE__ */ g({
__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(e, { emit: p }) {
let r = e, v = p, a = m(null), n = m(r.visible);
return c(() => r.visible, (o) => {
n.value = o;
}), c(() => n.value, (o) => {
v("update:visible", o);
}), (o, s) => {
const b = l("l-form"), y = l("el-scrollbar"), O = l("el-dialog");
return h(), R(O, w({
modelValue: d(n),
"onUpdate:modelValue": s[0] || (s[0] = (u) => x(n) ? n.value = u : n = u)
}, o.$attrs), {
footer: t(() => [
i(o.$slots, "footer", { form: d(a) })
]),
default: t(() => [
f(y, { height: "450px" }, {
default: t(() => [
f(b, {
ref_key: "form",
ref: a,
options: e.options,
onOnPreview: e.onPreview,
onOnRemove: e.onRemove,
onBeforeRemove: e.beforeRemove,
onOnExceed: e.onExceed,
onOnSuccess: e.onSuccess,
onOnChange: e.onChange,
"label-width": "100px"
}, {
uploadArea: t(() => [
i(o.$slots, "uploadArea")
]),
uploadTip: t(() => [
i(o.$slots, "uploadTip")
]),
_: 3
/* FORWARDED */
}, 8, ["options", "onOnPreview", "onOnRemove", "onBeforeRemove", "onOnExceed", "onOnSuccess", "onOnChange"])
]),
_: 3
/* FORWARDED */
})
]),
_: 3
/* FORWARDED */
}, 16, ["modelValue"]);
};
}
}), B = {
install(e) {
e.component("l-modal-form", C);
}
};
export {
B as default
};