@scalar/api-client
Version:
the open source API testing client
31 lines (30 loc) • 972 B
JavaScript
import { defineComponent as a, computed as r, createBlock as s, openBlock as l, resolveDynamicComponent as m, normalizeStyle as d, withCtx as c, 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 z = /* @__PURE__ */ a({
__name: "HttpMethod",
props: {
as: {},
property: {},
short: { type: Boolean },
method: {}
},
setup(p) {
const t = p, e = r(
() => f(String(t.method || ""))
), n = r(() => y(t.method));
return (o, v) => (l(), s(m(o.as ?? "span"), {
class: "uppercase",
style: d({ [o.property || "color"]: e.value.colorVar })
}, {
default: c(() => [
h(o.$slots, "default"),
i(" " + u(o.short ? e.value.short : n.value), 1)
]),
_: 3
}, 8, ["style"]));
}
});
export {
z as default
};