I want to run setInterval
just in the scope of a specific component (limit to that component not the whole of application) because I'm using SPA mode by Quasar framework.
When I set this function it causes run in everywhere even I changed the page's URL. Also, I checked this link (how to use setInterval in Vue component) but it wasn't my answer.
My sample code:
methods:
testInterval: function () {
setInterval(() => this.playCMD(), 2000)
},
playCMD: function () {
// Do something
console.log('Do something')
}
Also, it's better to say I want to limit doing something in the specific scope in VueJs, not in the whole of the application when we use it through SPA mode.