Here is what I have:
<template>
<div>
<input v-model.number="money">
<p>{{money}}</p>
</div>
</template>
<script>
name: 'MyComponent',
data () {
return {
money: 0
}
}
</script>
After getting the input value, if I change the value of money in data by some methods , how can I get the original input value? Is it a good practice? Should I assign the input value to another variable?
change money in data by some methodsmeans returns a value that is based onmoneyproperty, you can usecomputedproperty in Vue.money? If you want to display something which value is calculated bymoneylike {{ computedMoney }}, you can do it as Michael suggested. vuejs.org/v2/guide/computed.html