UNPKG

@scalar/api-client

Version:

the open source API testing client

31 lines (30 loc) 972 B
import { defineComponent as l, computed as r, createBlock as s, openBlock as p, resolveDynamicComponent as m, normalizeStyle as c, withCtx as d, renderSlot as h, createTextVNode as i, toDisplayString as u } from "vue"; import { getHttpMethodInfo as f } from "@scalar/helpers/http/http-info"; import { normalizeHttpMethod as y } from "@scalar/helpers/http/normalize-http-method"; const x = /* @__PURE__ */ l({ __name: "HttpMethod", props: { as: {}, property: {}, short: { type: Boolean }, method: {} }, setup(t) { const e = t, o = r( () => f(String(e.method || "")) ), n = r(() => y(e.method)); return (a, v) => (p(), s(m(t.as ?? "span"), { class: "uppercase", style: c({ [t.property || "color"]: o.value.colorVar }) }, { default: d(() => [ h(a.$slots, "default"), i(" " + u(t.short ? o.value.short : n.value), 1) ]), _: 3 }, 8, ["style"])); } }); export { x as default };