While diving into learning Vuejs, I decided to test out the Watch property during a work break. However, it seems that it's not functioning properly. Can anyone spot what's causing the issue in the code snippet below?
<div id="k2c">
Kilometers : <input v-model= "Kilometers">
Meters : <input v-model = "Meters">
</div>
<script type="text/javascript">
var vr = new Vue({
el:'#k2c',
data:{
Kilometers: 0;
Meters : 0;
},
methods:{
},
computed:{
},
watch : {
Kilometers : function(val){
this.Kilometers = val;
this.Meters = val * 1000;
},
Meters : function(val){
this.Kilometers = val / 1000;
this.Meters = val;
}
}
});
</script>