doc.yeswiki.pro/node_modules/vitepress/dist/client/app/ssr.js

11 lines
320 B
JavaScript
Raw Normal View History

2023-05-20 16:37:42 +00:00
// 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;
}