@javaguns/flow-ui
Version:
``` <template> <a-spin :spinning="loading"> <FlowDesigner ref="flowDesigner" top="50px"> </FlowDesigner> </a-spin> </template> <script lang="ts" setup> import { ref, provide, onMounted } from 'vue'; import { FlowDesigner, LoadingKey } from '@j
75 lines (74 loc) • 2.55 kB
JavaScript
import { defineComponent as k, ref as N, watch as x, openBlock as o, createBlock as s, unref as t, withCtx as n, createElementBlock as v, Fragment as c, renderList as i, createVNode as E, createElementVNode as g, toDisplayString as V, renderSlot as b, createCommentVNode as C } from "vue";
import { pluginManager as r } from "@javaguns/utils";
const G = k({ name: "flow-radio-group" }), $ = /* @__PURE__ */ k({
...G,
props: {
datas: { default: () => [] },
span: { default: 8 },
row: { type: Boolean, default: !1 },
modelValue: { default: 8 }
},
emits: ["update:modelValue", "change"],
setup(y, { emit: w }) {
const _ = r.getComponent("RadioGroup"), f = r.getComponent("Radio"), R = r.getComponent("Row"), h = r.getComponent("Col"), l = y, a = N(l.modelValue);
x(
() => l.modelValue,
(u) => {
a.value = u;
}
);
const m = w, B = () => {
m("update:modelValue", a.value), m("change", a.value);
};
return (u, d) => (o(), s(t(_), {
modelValue: a.value,
"onUpdate:modelValue": d[0] || (d[0] = (e) => a.value = e),
value: a.value,
"onUpdate:value": d[1] || (d[1] = (e) => a.value = e),
onChange: B
}, {
default: n(() => [
l.row ? (o(), s(t(R), { key: 0 }, {
default: n(() => [
(o(!0), v(c, null, i(l.datas, (e, p) => (o(), s(t(h), {
span: l.span,
key: p,
style: { "line-height": "30px" }
}, {
default: n(() => [
E(t(f), {
value: e.value,
label: e.value,
disabled: e.disabled
}, {
default: n(() => [
g("span", null, V(e.name), 1),
e.slot ? b(u.$slots, e.slot, { key: 0 }) : C("", !0)
]),
_: 2
}, 1032, ["value", "label", "disabled"])
]),
_: 2
}, 1032, ["span"]))), 128))
]),
_: 3
})) : (o(!0), v(c, { key: 1 }, i(l.datas, (e, p) => (o(), s(t(f), {
value: e.value,
label: e.value,
disabled: e.disabled,
key: p
}, {
default: n(() => [
g("span", null, V(e.name), 1),
e.slot ? b(u.$slots, e.slot, { key: 0 }) : C("", !0)
]),
_: 2
}, 1032, ["value", "label", "disabled"]))), 128))
]),
_: 3
}, 8, ["modelValue", "value"]));
}
});
export {
$ as default
};