In my Vue app, I have a timer and a text field.
When I try to decrease the remaining seconds, the changes I make in the field keep disappearing. The timer and the field are completely unrelated.
Here's a simple demo, write anything to the field:
https://codepen.io/basabence/pen/jObwqgL
<div id="app">
<span>Time: {{remaining_time}}</span><br>
<input :value="step_answer" type="text">
</div>
app = new Vue({
el: '#app',
data: {
remaining_seconds: 60,
step_answer: "asdasd",
},
created: function (){
setInterval(()=>{
this.remaining_seconds--
},1000);
}
})
Interestingly if I change the :value
to v-model, it works fine - but I don't want to bind this field two-way... Have any of you met this behaviour before?
Thank you in advance