Hello,
I have set “setInterval” function and its working properly, but i need “clearInterval” function but not working.
Please help me.
Hello,
I have set “setInterval” function and its working properly, but i need “clearInterval” function but not working.
Please help me.
It is a default browser function, make sure you use it correctly
yes,
//global var assign
var refreshIntervalId ;
return {
methods: {
stopWatch: function(){
refreshIntervalId = setInterval(function(){ },1000);
},
question: function(){
clearInterval(refreshIntervalId);
}
}
}
In case you run stopWatch twice or more, it won’t be possible to stop it. Clear it also before assigning new one
yes, when click question method then clearInterval time.