<div id="test_1">
<form id="form_1">
<p>
price:<input name="price" type="text" v-model="price">
</p>
<p>
cents: <span>{{cents}}</span>
</p>
</form>
</div>
</body>
<script>
var test_1VM = new Vue({
el: '#test_1',
data: {
cents: 100
},
computed: {
price: {
set: function(newValue) {
this.cents = newValue * 100;
},
get: function() {
return (this.cents / 100);
}
}
}
});
</script>