@scalar/api-reference
Version:
Generate beautiful API references from OpenAPI documents
43 lines (42 loc) • 1.3 kB
JavaScript
import { defineComponent as n, computed as i, createBlock as o, createCommentVNode as r, openBlock as a, unref as l, withCtx as c } from "vue";
import { getResolvedRef as h } from "@scalar/workspace-store/helpers/get-resolved-ref";
import p from "./ClassicLayout.vue.js";
import d from "./ModernLayout.vue.js";
import u from "../../Lazy/Lazy.vue2.js";
const v = /* @__PURE__ */ n({
__name: "Models",
props: {
schemas: { default: () => ({}) },
models: {},
hash: {},
options: {}
},
setup(m) {
const t = i(() => (m.models?.children ?? []).filter((s) => s.type === "model").map((s) => ({
id: s.id,
name: s.name,
schema: h(m.schemas[s.name])
})));
return (e, s) => e.schemas && Object.keys(e.schemas).length > 0 ? (a(), o(l(u), {
key: 0,
id: "models",
isLazy: !!e.hash && !e.hash.startsWith("model")
}, {
default: c(() => [
e.options?.layout === "classic" ? (a(), o(p, {
key: 0,
options: e.options,
schemas: t.value
}, null, 8, ["options", "schemas"])) : (a(), o(d, {
key: 1,
options: e.options,
schemas: t.value
}, null, 8, ["options", "schemas"]))
]),
_: 1
}, 8, ["isLazy"])) : r("", !0);
}
});
export {
v as default
};