epic-designer-cjh
Version:
基于vue3的设计器,可视化开发页面表单
121 lines (120 loc) • 3.5 kB
JavaScript
import { defineComponent as g, ref as f, watch as p, h as r, nextTick as h } from "vue";
import { N as x } from "./Upload-4254b22d.js";
import "./index-97ce4605.js";
import "./Button-e71f72ac.js";
import "./index-4562f02c.js";
import "./use-rtl-d05cb593.js";
import "./index-e2a664aa.js";
import "./icon-switch.cssr-d74fe364.js";
import "./use-is-mounted-a0b9f33e.js";
import "./light-76d75dc8.js";
import "./isArrayLikeObject-e5e231b4.js";
import "./_overRest-dc82ce77.js";
import "./use-memo-01b53d71.js";
import "./use-form-item-4d43edfb.js";
import "./create-key-76a2bf3d.js";
import "./resolve-slot-d8544b74.js";
import "./FadeInExpandTransition-596a1c51.js";
import "./use-style-b9e822e4.js";
import "./Icon-6fe59076.js";
import "./format-length-59d2d3ae.js";
import "./fade-in-scale-up.cssr-104df6e0.js";
import "./flatten-3c263333.js";
import "./replaceable-3545da1a.js";
import "./_baseSlice-4d543985.js";
import "./index-b826a2e2.js";
import "./use-false-until-truthy-cceb153b.js";
import "./index-f636e660.js";
import "./delegate-6e021bb9.js";
import "./index-ea4aeba0.js";
import "./_baseIteratee-9edfdc6e.js";
import "./_baseIsEqual-2f2ed312.js";
import "./hasIn-b4ac620c.js";
import "./clickoutside-3b4c9484.js";
import "./mousemoveoutside-95e23ec7.js";
import "./use-merged-state-7348d957.js";
import "./fade-in-height-expand.cssr-52e7384f.js";
const tt = g({
props: {
modelValue: {
type: Array,
default: () => []
}
},
emits: ["update:modelValue"],
setup(a, { emit: l, attrs: m }) {
const o = f([]);
p(o, (t) => {
l("update:modelValue", t);
}), p(
() => a.modelValue,
(t) => {
if (t != null && t.length > 0 && o.value != null) {
if (o.value === t)
return;
o.value.length = 0, o.value.push(...t);
}
},
{ deep: !0, immediate: !0 }
);
function n(t) {
console.log("onChange called->", t), h(() => {
o.value = t;
});
}
const s = ({ file: t, event: i }) => {
var e;
console.log("OnFinish called->", t, i);
const d = i == null ? void 0 : i.target, c = JSON.parse(d.response ?? "{}");
t.url = (e = c.data) == null ? void 0 : e.url;
}, u = ({ file: t, event: i }) => {
console.log("OnError called->", t, i);
};
return () => r(
"div",
{
class: "epic-upload-image"
},
{
default: () => [
r(
x,
{
...m,
"list-type": "image-card",
accept: "image/gif,image/jpeg,image/jpg,image/png,image/svg",
"onUpdate:file-list": n,
"file-list": o.value,
onFinish: s,
onError: u
},
{
default: () => [
r(
"div",
{ style: { "text-align": "center" } },
{
default: () => [
r("span", {
class: "iconfont epic-icon-shangchuan1 text-md",
style: { "margin-right": "2px" }
}),
r(
"div",
{ class: "ant-upload-text" },
{ default: () => "点击上传" }
)
]
}
)
]
}
)
]
}
);
}
});
export {
tt as default
};