Subscribe on changes!

Slot with dynamic name attribute does not update contents

avatar
Oct 31st 2020

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.

avatar
Nov 2nd 2020

You need to add a key to the slot:

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