Tutorialsplane

Vue.js setInterval


Vue.js setInterval– We can use native setInterval in Vue.JS. Here in this tutorial, we are going to explain how to use setInterval function Vue.JS with example and demo.


How to Use setInterval in Vue.JS Example

You can use setInterval function vue.js simply as below-

Example:




 


<div id="app">
	 {{message}}
</div>
        


Try it »

In the above example we have created function testFunction and called setinterval function on mount state. Run the above example and wait for 2 seconds to see the output of interval function.

Output of above example-