@scalar/api-reference
Version:
Generate beautiful API references from OpenAPI documents
19 lines (18 loc) • 498 B
JavaScript
import { provide as t, inject as a } from "vue";
import { createSidebar as n } from "../helpers/create-sidebar.js";
const i = Symbol("sidebar"), d = (e) => {
if (e) {
const o = n(e);
return t(i, o), o;
}
const r = a(i);
if (!r)
throw new Error(
"useSidebar() was called without a collection and no sidebar instance was found. Make sure to call useSidebar(collection) in a parent component first."
);
return r;
};
export {
i as SIDEBAR_SYMBOL,
d as useSidebar
};