Thanks to visit codestin.com
Credit goes to github.com

Skip to content

No re-rendering in proxySlots #4947

@hywax

Description

@hywax

Environment

  • Operating System: Darwin
  • Node Version: v22.14.0
  • Nuxt Version: 4.0.3
  • CLI Version: 3.27.0
  • Nitro Version: 2.12.4
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Is this bug related to Nuxt or Vue?

Nuxt

Package

v3.x

Version

latest

Reproduction

https://codesandbox.io/p/devbox/frosty-goodall-2wn4kw

Description

If we make a condition for the appearance of a slot and it is initially false, then we will never see it. This is because slots are not reactive.

Components that contain an error:

  • CheckboxGroup
  • DropdownMenu
  • DropdownMenuContent
  • ContextMenu
  • ChangelogVersions
  • ChatMessages
  • ChatPrompt
  • DashboardSearch
  • DashboardSearchButton
  • content/ContentSearch
  • content/ContentSearchButton

Solutions

One way to solve this is to not create a variable, but to immediately write omit(slots, [‘...’]) in the template. This will fix the rendering error, but vue will still not show the number of available slots.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingp3-lowMinor cosmetic, edge case, or documentation issuev3#1289

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions