epic-designer-gold
Version:
基于vue3的设计器,可视化开发页面表单
39 lines (38 loc) • 1.07 kB
JavaScript
import { defineComponent as p, h as i } from "vue";
/* empty css */
import { ElSelect as m } from "element-plus";
const V = p({
emits: ["update:modelValue", "update:modelValueLabel"],
setup(b, { emit: t, attrs: u }) {
return () => {
function d(l = null) {
if (Object.prototype.toString.call(l) === "[object Array]") {
const o = l.map((a) => {
let n = e == null ? void 0 : e.options.find((r) => r.value === a);
return n || {
label: a,
value: a
};
});
t("update:modelValueLabel", o);
} else {
const o = e == null ? void 0 : e.options.find((a) => a.value === l);
o ? t("update:modelValueLabel", o) : t("update:modelValueLabel", {
label: l,
value: l
});
}
t("update:modelValue", l);
}
const e = {
...u,
key: String(u.multiple),
"onUpdate:modelValue": d
};
return i(m, e);
};
}
});
export {
V as default
};