I'm using vue.js to make a webpage. I have 3 class in a page, lets call them A B and C. I want to make 2 buttons, next and prev which will determine which class is active.
For example, if class A is active and the next button is pressed, class A will become inactive and B will be active. Pressing prev button will make class B inactive and A active.
this is my code
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators" >
<li data-target="#carouselExampleIndicators" v-for="(carousel, index) in carouselArray" :key="index" :data-slide-to="index"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item" v-for="(carousel, index) in carouselArray" :key="index"> //here is the active class
<img :src="carousel.carousel_image_url" class="carousel-img" data-interval="10" alt="...">
<div class="carousel-caption d-none d-md-block">
<h5>{{carousel.carousel_caption}}</h5>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev" aria-hidden="true"><i class="fas fa-chevron-left"></i></span>
<span class="sr-only"></span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next" aria-hidden="true"><i class="fas fa-chevron-right"></i></span>
<span class="sr-only"></span>
</a>
</div>