Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/nuxt/src/head/runtime/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const globalProps = {
// <script>
export const Script = defineComponent({
name: 'Script',
inheritAttrs: false,
props: {
...globalProps,
async: Boolean,
Expand Down Expand Up @@ -88,6 +89,7 @@ export const Script = defineComponent({
// <link>
export const Link = defineComponent({
name: 'Link',
inheritAttrs: false,
props: {
...globalProps,
as: String,
Expand Down Expand Up @@ -121,6 +123,7 @@ export const Link = defineComponent({
// <base>
export const Base = defineComponent({
name: 'Base',
inheritAttrs: false,
props: {
...globalProps,
href: String,
Expand All @@ -134,6 +137,7 @@ export const Base = defineComponent({
// <title>
export const Title = defineComponent({
name: 'Title',
inheritAttrs: false,
setup: setupForUseMeta((_, { slots }) => {
const title = slots.default?.()?.[0]?.children || null
if (process.dev && title && typeof title !== 'string') {
Expand All @@ -148,6 +152,7 @@ export const Title = defineComponent({
// <meta>
export const Meta = defineComponent({
name: 'Meta',
inheritAttrs: false,
props: {
...globalProps,
charset: String,
Expand All @@ -163,6 +168,7 @@ export const Meta = defineComponent({
// <style>
export const Style = defineComponent({
name: 'Style',
inheritAttrs: false,
props: {
...globalProps,
type: String,
Expand Down Expand Up @@ -193,12 +199,14 @@ export const Style = defineComponent({
// <head>
export const Head = defineComponent({
name: 'Head',
inheritAttrs: false,
setup: (_props, ctx) => () => ctx.slots.default?.()
})

// <html>
export const Html = defineComponent({
name: 'Html',
inheritAttrs: false,
props: {
...globalProps,
manifest: String,
Expand All @@ -211,6 +219,7 @@ export const Html = defineComponent({
// <body>
export const Body = defineComponent({
name: 'Body',
inheritAttrs: false,
props: globalProps,
setup: setupForUseMeta(bodyAttrs => ({ bodyAttrs }), true)
})