[Vuejs]-Vue.js connect v-model value, but it would be changeable to other value.

0👍

You can make use of a computed setter as follows:

data() {
    return {
         roundFee : 5000,
         changedPrice: {
             c1: 0,
             c2: 0,
         }
     },
     computed: {
         secondInput: {
             get() {
                 return this.roundFee;
             },
             set(newValue) {
                 this.changedPrice.c1 = newValue;
             }
         }
     }
 }

And then bind this computed property secondInput to your input

<input type="text" class="form-control" disabled v-model="roundFee"> $ 
<input type="text" class="form-control" v-model="secondInput"> $

Leave a comment