I want to make buttons previously and next, but I a little not understand how its realized, because starting learning vue recently
I have methods which I should write this.activeindex < this.activeindex -1 and etc how I can make it?
const App = {
data() {
return {
activeIndex: 0,
steps: [
]
}
},
methods: {
prev() {
},
reset() {
},
nextOfFinish() {
},
setActive(idx) {
}
},
computed: {
}
}
Vue.createApp(App).mount('#app')
in html I have this code
<div class="steps-content">
</div>
<ul class="steps-list">
<li class="steps-item active"><span>1</span> Шаг 1</li>
<li class="steps-item"><span>2</span> Шаг 2</li>
<li class="steps-item"><span>3</span> Шаг 3</li>
<li class="steps-item"><span>4</span> Шаг 4</li>
</ul>
<div>
<button class="btn">Назад</button>
<button class="btn primary">Вперед</button>
</div>