UNPKG

vuux

Version:

Vue3 Nuxt3 Nuxt4 组件库

38 lines (37 loc) 1.09 kB
import { defineComponent as f, createElementBlock as e, openBlock as t, createElementVNode as o, createCommentVNode as n, unref as s, toDisplayString as i, renderSlot as _, createVNode as u, Transition as p, withCtx as h } from "vue"; import { useItemForm as k } from "./hook/useItemForm.mjs"; const v = { class: "form-item" }, b = { class: "form-label" }, y = { key: 0, class: "is-required" }, C = { class: "form-field" }, E = { key: 0, class: "form-tip" }, q = /* @__PURE__ */ f({ name: "FormItem", __name: "item", props: { label: {}, field: {} }, setup(r) { const a = r, { isRequired: l, isError: m, message: c } = k(a); return (d, N) => (t(), e("div", v, [ o("div", b, [ s(l) ? (t(), e("span", y, "*")) : n("", !0), o("span", null, i(r.label), 1) ]), o("div", C, [ _(d.$slots, "default"), u(p, { name: "fade" }, { default: h(() => [ s(m) ? (t(), e("div", E, i(s(c)), 1)) : n("", !0) ]), _: 1 }) ]) ])); } }); export { q as default };