UNPKG

@scalar/api-reference

Version:

Generate beautiful API references from OpenAPI documents

42 lines (41 loc) 1.64 kB
import { defineComponent, createElementBlock, renderSlot, openBlock, createElementVNode, createVNode, unref, createTextVNode } from "vue"; import { ScalarIconLink } from "@scalar/icons"; const _hoisted_1 = ["id"]; const _hoisted_2 = { class: "sr-only" }; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "WithBreadcrumb", props: { breadcrumb: {}, eventBus: {} }, setup(__props) { return (_ctx, _cache) => { return __props.breadcrumb && __props.breadcrumb.length > 0 ? (openBlock(), createElementBlock("div", { key: 0, id: __props.breadcrumb.join("."), class: "relative scroll-mt-24" }, [ renderSlot(_ctx.$slots, "default"), createElementVNode("button", { class: "text-c-3 hover:text-c-1 absolute -top-2 -left-4.5 flex h-[calc(100%+16px)] w-4.5 cursor-pointer items-center justify-center pr-1.5 opacity-0 group-hover:opacity-100 focus-visible:opacity-100", type: "button", onClick: _cache[0] || (_cache[0] = () => __props.eventBus?.emit("copy-url:nav-item", { id: __props.breadcrumb.join(".") })) }, [ createVNode(unref(ScalarIconLink), { class: "size-3", weight: "bold" }), createElementVNode("span", _hoisted_2, [ renderSlot(_ctx.$slots, "sr-label", {}, () => [ _cache[1] || (_cache[1] = createTextVNode("Copy link to ", -1)), renderSlot(_ctx.$slots, "default") ]) ]) ]) ], 8, _hoisted_1)) : renderSlot(_ctx.$slots, "default", { key: 1 }); }; } }); export { _sfc_main as default };