Skip to content Skip to sidebar Skip to footer

Function Of Setinterval In Vue.js

I want to perform a while loop with one second of interval. The method which I want to operate is; new Vue({ el: '#app14', data: { dealerCards: [], }, compu

Solution 1:

The function of setInterval should be like this;

var dd = setInterval(() => {
    this.dealerCards.push(Draw());
    console.log("DH: " + this.dealerHand);

    if (this.dealerHand >= 17) {
        clearInterval(dd);
    }
}, 1000);

Post a Comment for "Function Of Setinterval In Vue.js"