'Vue js 3 Passing dynamic model value inside a v-for
I'm working on a product page which has a gallery and this gallery needs to change when different options is selected.
to simplify, imagine this is the gallery:
<swiper-slide v-for="image in product.option" :key="image.id">
and I've radio buttons like this:
<RadioGroup v-model="optionChoice">
I need to somehow pass optionChoice to v-for so it dynamically change when user selects an option. something like this:
<swiper-slide v-for="image in product.{{optionChoice}}" :key="image.id">
Can someone guide me?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
