doc.yeswiki.pro/node_modules/vitepress/dist/client/app/ssr.js
2023-05-20 19:38:02 +03:00

10 lines
320 B
JavaScript

// entry for SSR
import { createApp } from './index';
import { renderToString } from 'vue/server-renderer';
export async function render(path) {
const { app, router } = await createApp();
await router.go(path);
const ctx = { content: '' };
ctx.content = await renderToString(app, ctx);
return ctx;
}