Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slot with dynamic name attribute does not update contents #2535

Closed
lukewarlow opened this issue Oct 31, 2020 · 1 comment
Closed

Slot with dynamic name attribute does not update contents #2535

lukewarlow opened this issue Oct 31, 2020 · 1 comment
Labels
🐞 bug Something isn't working scope: compiler

Comments

@lukewarlow
Copy link

Version

3.0.2

Reproduction link

https://codesandbox.io/s/elegant-silence-k52xk

Steps to reproduce

Go to https://codesandbox.io/s/elegant-silence-k52xk and click the tabs.

What is expected?

The contents of Tabs.vue's slot should change.

What is actually happening?

The contents of the first tab displays, but never changes.


I have the same code in a vue 2 sandbox and it works as expected. See https://codesandbox.io/s/hungry-hill-lf8xo.
I have looked but cannot find any documented reason why this wouldn't work the same in Vue 3.

@lukewarlow lukewarlow changed the title Slot with name dynamic name attribute does not update contents Slot with dynamic name attribute does not update contents Oct 31, 2020
@LinusBorg LinusBorg added 🐞 bug Something isn't working scope: compiler labels Nov 1, 2020
@HcySunYang
Copy link
Member

You need to add a key to the slot:

<slot :name="activeTab" :key="activeTab"></slot>

@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working scope: compiler
Projects
None yet
Development

No branches or pull requests

3 participants