0👍
As Michael said, you can achieve this behavior via scoped slots.
In your carousel component, the template will look like this :
<ul>
// TODO : Add a :key with a unique identifier
<li v-for="item in items">
<slot name="item" :item="item">
{{ item }}
</template>
</li>
</ul>
And when using the component, you will do something like this :
<carousel :items="images">
<img #item="{ src }" :src="src">
</carousel>
Depending on your images
data, you may need to get the source from another property.
- [Vuejs]-How to include external JavaScript library properly so that its class is avialable in VueJs component?
- [Vuejs]-How to import extrenal library on mounted hook in Nuxt Js?
Source:stackexchange.com