1

I have a string vector that I'm gettig from js, when this variable has just one element the image is rendered. Below is my code (to work with one element I have to comment template). What is the right way to render images in carousel, maybe I'm missing the key value here.

                <template for:each={img} for:item="rec" for:index="index">                  
                    <lightning-carousel-image
                        key= "rec"
                        src={rec.img}
                        header="Image"
                        description="Image"
                        alternative-text="This is a card">
                    </lightning-carousel-image>
                </template>

1 Answer 1

1

You can use the img src as the key:

key={rec.img}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .