I'm trying to reduce the value of a data property in every 1 second as follows:
data() {
return {
timer: null
}
},
mounted() {
this.timer = 50;
window.setInterval(() => {
this.$set(this, 'timer', this.timer - 1)
}, 1000);
},
https://jsfiddle.net/eywraw8t/8179/
In the Vue devTool, the timer is not automatically updated. However, in the jsfiddle, the output is getting updated. Is this reactive? If not, how can I make it reactive?
timervalue is not updating. I'm wondering if it's usual or the reactivity is lost.