Vue js triggering a method/function every x seconds
Just to combine the solutions (since I’m unable to edit), the code below works. One gotcha is that you also want the job to stop once the view is destroyed, so you’ll want to clear it when the beforeDestroy hook is called mounted: function () { this.timer = setInterval(() => { this.countDown() }, 1000) }, … Read more