2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-23 22:30:34 +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 # built code
dist dist
ssr
lib lib
es es
__build__ __build__
+1 -3
View File
@@ -2,9 +2,7 @@ import { renderToString } from '@vue/server-renderer'
import type { App } from 'vue' import type { App } from 'vue'
import type { SSRContext } from '@vue/server-renderer' import type { SSRContext } from '@vue/server-renderer'
export async function renderToStringWithMeta (app: App): Promise<[string, SSRContext]> { export async function renderToStringWithMeta (app: App, ctx: SSRContext = {}): Promise<[string, SSRContext]> {
const ctx: SSRContext = {}
const html = await renderToString(app, ctx) const html = await renderToString(app, ctx)
// TODO: better way of determining whether meta was rendered with the component or not // TODO: better way of determining whether meta was rendered with the component or not