Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/components/nuxt-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export function defineNuxtLink (options: NuxtLinkOptions) {
// converts `""` to `null` to prevent the attribute from being added as empty (`rel=""`)
: firstNonUndefined<string | null>(props.rel, options.externalRelAttribute, href ? DEFAULT_EXTERNAL_REL_ATTRIBUTE : '') || null

return h('a', { href, rel, target }, slots.default())
return h('a', { href, rel, target }, slots.default?.())
}
}
}) as unknown as DefineComponent<NuxtLinkProps>
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/components/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Component } from 'vue'

const Fragment = {
setup (_props, { slots }) {
return () => slots.default()
return () => slots.default?.()
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/head/runtime/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export const Base = defineComponent({
export const Title = defineComponent({
name: 'Title',
setup: setupForUseMeta((_, { slots }) => {
const title = slots.default()?.[0]?.children || null
const title = slots.default?.()?.[0]?.children || null
if (process.dev && title && typeof title !== 'string') {
console.error('<Title> can only take a string in its default slot.')
}
Expand Down