Subscribe on changes!

Is possible to have recurring slots?

avatar
Oct 28th 2020

Version

3.0.2

Reproduction link

https://github.com/devidwong/recurring-slot

Steps to reproduce

  1. create recurring component with two (same) slots - one under component itself's tag
  2. render component and pass expected recurring details you want to be redered x times deep with different properties( by replies in this example)

What is expected?

rendering data deeply like json provided

What is actually happening?

after second level nesting is lost. No error appears


Is this was ever possible? I see use case for this. (rendering comments without flatmapping and defining inside html just once)

I cannot see anything in docs, google. I've set issue in stackoverflow as well - no answer

avatar
Oct 28th 2020

I found an workaround solution - detailsComponent passed as prop. It's in updated repository.

I don't know why I needed to do it - version from first commit looks nicer. But I'm also satisfied with actual.

I'm closing. Maybe there will be someone searching for 'recurring slot vue'. Thank you

avatar
Oct 28th 2020

Still seems like a bug to me, pretty sure you could do it in vue 2.

avatar
Oct 28th 2020

The repo he links to is Vue 2. It rather seems he missed to actually pass the parent slot to the child scoped slot.

An actual repo in Vue 3 would help.

avatar
Oct 28th 2020

Ups. My fault. I reproduced it in bigger app with vue 3. Here it's 2xx beacuse I used wrong Vue CLI option. Trust me it occurs the same in vue 3 - follow my commits. I spend whole day trying to archieve this. I don't have more time now to migrate. Providing details component as a prop for recursive component is ok for me - Just needed ONE place to do it. Thank you for checking. Feel free to continue. I will investigate later.