@layui/layui-vue
Version:
a component library for Vue 3 base on layui-vue
23 lines (22 loc) • 739 B
JavaScript
import { defineComponent as f, ref as i, createVNode as u, Fragment as c } from "vue";
const l = Array.isArray, d = f({ props: { setRef: { type: Function, required: !0 } }, setup(s, { slots: n }) {
const a = /* @__PURE__ */ ((...e) => (r) => {
e.forEach((t) => {
typeof t == "function" ? t(r) : t.value = r;
});
})(i(), (e) => {
e ? s.setRef(e.nextElementSibling) : s.setRef(null);
});
return () => {
var t;
const [e] = ((t = n.default) == null ? void 0 : t.call(n)) || [], r = ((o) => {
if (!l(o) || o.length > 1)
throw new Error("expect to receive a single Vue element child");
return o[0];
})(e.children);
return u(c, { ref: a }, [r]);
};
} });
export {
d as default
};