S
S
semki0962019-05-06 12:37:20
Vue.js
semki096, 2019-05-06 12:37:20

How to make the simplest slider on vue js?

We have 3 pictures, and a button to show slide number 3

data () {
                return {
                  slideActive: 1,
                  },
                }
            },  

            methods: {
                currentSlide: function (id) {
                   this.slideActive = id;
                }
            }

By clicking on the button, I get the number of the slide to be displayed.
Question. How now to show a slide by its number? You probably need to somehow link this with slideActive in data. I would be grateful for help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question