UNPKG

@open-data-v/ui

Version:

OpenDataV UI基础包

57 lines (56 loc) 1.7 kB
import { defineComponent as m, inject as h, computed as b, watch as f, onMounted as g, openBlock as o, createElementBlock as n, normalizeClass as k, createElementVNode as d, renderSlot as v, createCommentVNode as r, toDisplayString as y } from "vue"; const C = { key: 0, class: "radio-text" }, V = { key: 1, class: "radio-text" }, N = /* @__PURE__ */ m({ __name: "Radio", props: { disabled: { type: Boolean, default: !1 }, value: { type: [String, Boolean, Number] }, checked: { type: [String, Boolean, Number] }, modelValue: { type: [String, Boolean, Number] }, label: {} }, emits: ["update:value", "updateValue", "change"], setup(u, { emit: c }) { const a = u, t = c, l = h("OControlChange", ""), i = () => { if (a.disabled) return; const e = a.value || !0; t("change", e), t("update:value", e), t("updateValue", e), l && l(e, "change"); }, p = b(() => { let e; return a.value ? e = a.value === a.modelValue : e = !!a.modelValue, e; }); return f( () => a.checked, (e) => { l && l(e, "mounted"); } ), g(() => { l && l(a.checked, "mounted"); }), (e, s) => (o(), n("label", { class: k({ disabled: e.disabled, checked: p.value, "o-radio": !0 }), onClick: i }, [ d("span", null, [ s[0] || (s[0] = d("span", { class: "radio-inner" }, null, -1)), e.$slots.default ? (o(), n("span", C, [ v(e.$slots, "default") ])) : r("", !0), e.label ? (o(), n("span", V, y(e.label), 1)) : r("", !0) ]) ], 2)); } }); export { N as default }; //# sourceMappingURL=Radio.vue.esm.js.map