UNPKG

vuux

Version:

Vue3 Nuxt3 Nuxt4 组件库

31 lines (30 loc) 1.04 kB
import { defineComponent as s, createElementBlock as d, openBlock as c, unref as a, normalizeClass as p, createElementVNode as o, toDisplayString as u } from "vue"; import { useRadio as m } from "./hook/useRadio.mjs"; const f = ["name", "value", "checked"], k = { class: "radio-label" }, C = /* @__PURE__ */ s({ name: "Radio", __name: "index", props: { label: { type: [String, Number, Boolean], default: "默认选项" }, value: { type: [String, Number, Boolean], default: 0 } }, setup(i) { const e = i, { isChecked: n, handleClick: t } = m(e); return (b, l) => (c(), d("label", { class: p(["app-radio", { "is-checked": a(n) }]), onClick: l[0] || (l[0] = //@ts-ignore (...r) => a(t) && a(t)(...r)) }, [ o("input", { type: "radio", name: String(e.value), value: e.value, checked: a(n) }, null, 8, f), l[1] || (l[1] = o("div", { class: "radio-circle" }, null, -1)), o("p", k, u(e.label), 1) ], 2)); } }); export { C as default };