2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-05-17 04:29:37 +03:00

fix #672: support passing in the ssr context as arg

This commit is contained in:
pimlie
2021-05-04 10:52:35 +02:00
parent bffa8f15aa
commit 32b8e7aee3
2 changed files with 2 additions and 3 deletions
+1
View File
@@ -40,6 +40,7 @@ package-lock.json
# built code
dist
ssr
lib
es
__build__
+1 -3
View File
@@ -2,9 +2,7 @@ import { renderToString } from '@vue/server-renderer'
import type { App } from 'vue'
import type { SSRContext } from '@vue/server-renderer'
export async function renderToStringWithMeta (app: App): Promise<[string, SSRContext]> {
const ctx: SSRContext = {}
export async function renderToStringWithMeta (app: App, ctx: SSRContext = {}): Promise<[string, SSRContext]> {
const html = await renderToString(app, ctx)
// TODO: better way of determining whether meta was rendered with the component or not