I need my sHand
to increase by 6 every second, but currently it only increases once. When I try something like this.sHand++
, it works fine and increases by 1 degree per second. However, I want it to increase by 6 instead of 1. Any solutions?
data:{
sHand: 30
},
computed:{
style(){
return { transform: 'rotate(' + this.sHand + 'deg)'}
}
},
created(){
setInterval(() => {
this.sHand += 6 // not working :/
},1000)
}
<div :style="style" class="secondhand"></div>