UNPKG

@scalar/api-reference

Version:

Generate beautiful API references from OpenAPI documents

41 lines (40 loc) 1.15 kB
import { defineComponent as r, createElementBlock as s, openBlock as m, withModifiers as p, createVNode as n, createElementVNode as d, unref as c, withCtx as h, createTextVNode as u, toDisplayString as l } from "vue"; import { ScalarIconPlay as f } from "@scalar/icons"; import C from "../../components/ScreenReader.vue.js"; import { useApiClient as k } from "../api-client-modal/useApiClient.js"; const w = ["method"], R = /* @__PURE__ */ r({ __name: "TestRequestButton", props: { method: {}, path: {} }, setup(t) { const { client: a } = k(), i = () => { a.value?.open({ method: t.method, path: t.path }); }; return (e, o) => (m(), s("button", { class: "show-api-client-button", method: e.method, type: "button", onClick: p(i, ["stop"]) }, [ n(c(f), { class: "size-3", weight: "fill" }), o[0] || (o[0] = d("span", null, "Test Request", -1)), n(C, null, { default: h(() => [ u("(" + l(e.method) + " " + l(e.path) + ")", 1) ]), _: 1 }) ], 8, w)); } }); export { R as default };