UNPKG

winbox-ui-next

Version:

We Design Vue 2.0: A Vue.js 3 UI Library

33 lines (32 loc) 967 B
import { defineComponent, createVNode } from "vue"; import { getPrefixCls } from "../_utils/global-config.js"; import { getComponentNumber, getChildrenComponents } from "../_utils/vue-utils.js"; var _Breadcrumb = defineComponent({ name: "Breadcrumb", props: { maxCount: { type: Number, default: 0 } }, setup(props, { slots }) { const prefixCls = getPrefixCls("breadcrumb"); return () => { var _a, _b; const children = (_b = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : []; const total = getComponentNumber(children, "BreadcrumbItem"); const mergedChildren = getChildrenComponents(children, "BreadcrumbItem", (vn, index) => ({ index, total, maxCount: props.maxCount, separator: slots.separator })); return createVNode("div", { "class": prefixCls }, [mergedChildren]); }; } }); export { _Breadcrumb as default };