diff --git a/packages/nuxt/src/head/runtime/components.ts b/packages/nuxt/src/head/runtime/components.ts index 96e98fc00ef..f14bf2f16c9 100644 --- a/packages/nuxt/src/head/runtime/components.ts +++ b/packages/nuxt/src/head/runtime/components.ts @@ -1,9 +1,11 @@ -import { defineComponent } from 'vue' +import { defineComponent, PropType } from 'vue' import type { SetupContext } from 'vue' import { useHead } from './composables' type Props = Readonly> +type ReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'same-origin' | 'origin' | 'strict-origin' | 'origin-when-cross-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url' + const removeUndefinedProps = (props: Props) => Object.fromEntries(Object.entries(props).filter(([, value]) => value !== undefined)) @@ -73,7 +75,7 @@ export const Script = defineComponent({ integrity: String, nomodule: Boolean, nonce: String, - referrerpolicy: String, + referrerpolicy: String as PropType, src: String, type: String, /** @deprecated **/ @@ -128,7 +130,7 @@ export const Link = defineComponent({ type: Boolean, default: undefined }, - referrerpolicy: String, + referrerpolicy: String as PropType, rel: String, sizes: String, title: String,