UNPKG

@tanstack/vue-router

Version:

Modern and scalable routing for Vue applications

34 lines (33 loc) 989 B
import { RouterProvider } from "../RouterProvider.js"; import { Asset } from "../Asset.js"; import { useTags } from "../headContentUtils.js"; import { Scripts } from "../Scripts.js"; import * as Vue from "vue"; //#region src/ssr/RouterServer.tsx var ServerHeadContent = Vue.defineComponent({ name: "ServerHeadContent", setup() { const getTags = useTags(); return () => getTags().map((tag) => Vue.h(Asset, { key: tag.tag + tag.id, ...tag })); } }); var RouterServer = Vue.defineComponent({ name: "RouterServer", props: { router: { type: Object, required: true } }, setup(props) { return () => Vue.h("html", null, [Vue.h("head", null, [Vue.h(ServerHeadContent)]), Vue.h("body", null, [Vue.h("div", { id: "__app" }, [Vue.h(RouterProvider, { router: props.router }, { innerWrap: (innerProps) => [ Vue.h(ServerHeadContent), innerProps.children, Vue.h(Scripts) ] })])])]); } }); //#endregion export { RouterServer }; //# sourceMappingURL=RouterServer.js.map