fix(nuxt): set `inheritAttrs: false` for fragment components (#28939)

This commit is contained in:
Daniel Roe 2024-09-11 10:26:10 +01:00
parent 8e4585c141
commit 66d0b8ccdc
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B
6 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import { defineComponent } from 'vue'
export default defineComponent({
name: 'DevOnly',
inheritAttrs: false,
setup (_, props) {
if (import.meta.dev) {
return () => props.slots.default?.()

View File

@ -8,6 +8,7 @@ import { createError } from '../composables/error'
import { islandComponents } from '#build/components.islands.mjs'
export default defineComponent({
name: 'IslandRenderer',
props: {
context: {
type: Object as () => { name: string, props?: Record<string, any> },

View File

@ -45,6 +45,7 @@ async function loadComponents (source = appBaseURL, paths: NuxtIslandResponse['c
export default defineComponent({
name: 'NuxtIsland',
inheritAttrs: false,
props: {
name: {
type: String,

View File

@ -18,6 +18,7 @@ export const NuxtTeleportIslandSymbol = Symbol('NuxtTeleportIslandComponent') as
/* @__PURE__ */
export default defineComponent({
name: 'NuxtTeleportIslandComponent',
inheritAttrs: false,
props: {
to: {
type: String,

View File

@ -9,6 +9,7 @@ import { NuxtTeleportIslandSymbol } from './nuxt-teleport-island-component'
/* @__PURE__ */
export default defineComponent({
name: 'NuxtTeleportIslandSlot',
inheritAttrs: false,
props: {
name: {
type: String,

View File

@ -7,7 +7,7 @@ import { devRootDir } from '#build/nuxt.config.mjs'
export default (url: string) => defineComponent({
name: 'NuxtTestComponentWrapper',
inheritAttrs: false,
async setup (props, { attrs }) {
const query = parseQuery(new URL(url, 'http://localhost').search)
const urlProps = query.props ? destr<Record<string, any>>(query.props as string) : {}