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