gs-shop / vue-slick-carousel

🚥Vue Slick Carousel with True SSR Written for ⚡Faster Luxstay
https://gs-shop.github.io/vue-slick-carousel/
Other
801 stars 186 forks source link

Fix carousel slot rendering skipped inner scopedSlots #284

Open Kapcash opened 5 months ago

Kapcash commented 5 months ago

When rendering the carousel slot with a component, itself using a scopedSlot, it won't be rendered correctly. The scopedSlot is skipped and our component is rendered as if it didn't received any slot.

Example:

<VueSlickCarousel>
  <CarouselCard>
    <h1>Here is my carousel card</h1>
    <template #footer="{ name }"> <!-- This won't be rendered -->
      Author: {{ name }}
    </template>
  </CarouselCard>
</VueSlickCarousel>

Here, the scoped slot footer is never rendered, as if we never passed it.


I digged into the library to understand the problem and turns out it's a simple typo in the keys to copy when cloning the children vnode...

Note: I know this won't be merged as the library isn't maintained anymore. I published this fix on my own fork and I'm using this in production for probably ever.