UNPKG

@scalar/api-client

Version:

the open source API testing client

22 lines (21 loc) 765 B
import { createApp as p } from "vue"; import { createRouter as o, createWebHistory as c, createWebHashHistory as s } from "vue-router"; import n from "../App.vue.js"; /* empty css */ import { ROUTES as a } from "./routes.js"; const m = (e) => e === "web" ? o({ history: c(), routes: a }) : o({ history: s(), routes: a }), A = (e, { layout: r = "desktop", plugins: i }) => { const t = p(n, { layout: r, plugins: i }); if (t.use(m(r)), !e) { console.error( "[@scalar/api-client-modal] Could not create the API client.", "Invalid HTML element provided.", "Read more: https://github.com/scalar/scalar/tree/main/packages/api-client" ); return; } t.mount(e); }; export { A as createApiClientApp, m as createAppRouter };