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:
@@ -40,6 +40,7 @@ package-lock.json
|
|||||||
|
|
||||||
# built code
|
# built code
|
||||||
dist
|
dist
|
||||||
|
ssr
|
||||||
lib
|
lib
|
||||||
es
|
es
|
||||||
__build__
|
__build__
|
||||||
|
|||||||
+1
-3
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user