diff --git a/packages/unhead/src/plugins/payload.ts b/packages/unhead/src/plugins/payload.ts index 551ea019..487869b5 100644 --- a/packages/unhead/src/plugins/payload.ts +++ b/packages/unhead/src/plugins/payload.ts @@ -4,9 +4,10 @@ export default defineHeadPlugin({ mode: 'server', hooks: { 'tags:resolve': function (ctx) { - const payload: { titleTemplate: string | ((s: string) => string); templateParams: Record; title: string } = {} + const payload: { titleTemplate?: string | ((s: string) => string); templateParams?: Record; title?: string } = {} ctx.tags.filter(tag => ['titleTemplate', 'templateParams', 'title'].includes(tag.tag) && tag._m === 'server') .forEach((tag) => { + // @ts-expect-error untyped payload[tag.tag] = tag.tag.startsWith('title') ? tag.textContent : tag.props }) // add tag for rendering