UNPKG

@coderlt/form-designer

Version:

基于vue3的设计器,可视化开发页面表单

106 lines (105 loc) 3.05 kB
import { defineComponent as f, ref as h, watch as p, h as i, nextTick as g } from "vue"; import { N } from "./Upload-9e0c1420.js"; import { N as V } from "./Button-ec24d1ba.js"; import "./index-74b7090f.js"; import "./resolve-slot-d8544b74.js"; import "./Icon-6108e834.js"; import "./use-rtl-9463c170.js"; import "./index-e2a664aa.js"; import "./use-style-9f377525.js"; import "./FadeInExpandTransition-596a1c51.js"; import "./format-length-59d2d3ae.js"; import "./fade-in-scale-up.cssr-58b411db.js"; import "./flatten-3c263333.js"; import "./replaceable-bccb4dce.js"; import "./_baseSlice-4d543985.js"; import "./light-724e7cfe.js"; import "./isArrayLikeObject-371fab9d.js"; import "./_overRest-b6d63194.js"; import "./index-4562f02c.js"; import "./index-b826a2e2.js"; import "./use-false-until-truthy-cceb153b.js"; import "./index-f636e660.js"; import "./delegate-6e021bb9.js"; import "./create-key-76a2bf3d.js"; import "./use-memo-01b53d71.js"; import "./index-ea4aeba0.js"; import "./use-is-mounted-a0b9f33e.js"; import "./_baseIteratee-bd69c7db.js"; import "./_baseIsEqual-ee7e3824.js"; import "./hasIn-61ab08dc.js"; import "./clickoutside-3b4c9484.js"; import "./mousemoveoutside-95e23ec7.js"; import "./use-merged-state-7348d957.js"; import "./icon-switch.cssr-61f52d75.js"; import "./fade-in-height-expand.cssr-de8455a1.js"; import "./use-form-item-8e7a66db.js"; const to = f({ props: { modelValue: { type: Array, default: () => [] } }, emits: ["update:modelValue"], setup(e, { emit: a, attrs: m }) { const t = h([]); p(t, (o) => { a("update:modelValue", o); }), p( () => e.modelValue, (o) => { if (o != null && o.length > 0 && t.value != null) { if (t.value === o) return; t.value.length = 0, t.value.push(...o); } }, { deep: !0, immediate: !0 } ); function n(o) { console.log("onChange called->", o), g(() => { t.value = o; }); } const u = ({ file: o, event: r }) => { console.log("OnError called->", o, r); }, s = ({ file: o, event: r }) => { var l; console.log("OnFinish called->", o, r); const d = r == null ? void 0 : r.target, c = JSON.parse(d.response ?? "{}"); o.url = (l = c.data) == null ? void 0 : l.url; }; return () => i("div", null, { default: () => [ i(N, { ...m, "onUpdate:file-list": n, "file-list": t.value, onError: u, onFinish: s, "default-upload": !0 }, { default: () => [ i( V, {}, { default: () => [ i("span", { class: "iconfont epic-icon-shangchuan1", style: { "margin-right": "2px" } }), i("span", null, { default: () => "上传文件" }) ] } ) ] }) ] }); } }); export { to as default };