In vue, use v-model to bind values on multiple input, how to get the value of the current focus input box, and change its value;

how to get the values of multiple elements that gain focus in input boxes bound with v-model

I am working on a mobile project. To enter the price, I have built a keyboard. I want to change the value obtained after each keyboard click into a string and splice it with the previous value, and Synchronize to the corresponding input box. Ask the boss to give me an idea

related codes

< input type= "text" class= "carriageprice" v text model = "carriage" placeholder= "0.00" ref= "carriageprice" >
< input type= "text" class= "inputprice" v rape model = "originalprice" placeholder= "0.00" >

I have got the value after the keyboard click, but I don"t know how to insert the value into the corresponding data

Apr.20,2021

Click the keyboard to get the keyboard value 1, and then this.originalprice+=1 it


throw a brick to attract jade, the idea is as follows
keyboard only?
1-- unique, then adjust the keyboard through the @ focus trigger method, and save the unique flag of the input that triggers the keyboard through variables to ensure that the changed value corresponds to
2-- not unique, and constitutes a separate business logic component with the input component. Then the identification is processed internally. Generally consider the method of changing the value of the timestamp
-string concatenation, including deleting and emptying the string, and handling the corresponding variable

through a unique flag.
<input @focus="inputOnFocus" v-model="inputValue" id="test1"/>
...
data(){
 inutFocus:'inputId',
 inputValue:''
},
methods:{
  inputOnFocus(e){//input iteminput,event
    this.showKeyBoard();
    this.inutFocus = e.target.id //item  = item.id
  },
  keyboardClick(){
    //
    let clickValue = 'a';
    this.inputValue += clickValue;// inputValue
  }
}

still does not quite understand, my keyboard is the only one, I also set the method on the keyboard to get the current value I clicked on the method, and debug the output of the value is correct. I use the code var x = document.activeElement.nodeValue; to dynamically get which box the current focus is in and get its current value. My consideration is that every time I click on the keyboard, this code is executed so that I can get the last value, and then concatenate y = x.toString () + key.toString ();, and then assign the value to the current input box. The problem now is that, first, even if I assign the initial value to a real number (that is, not zero) in both input boxes, I always output x = null. Second, after stitching, how to assign the value to the current input box, and how to get its v-model binding value through the focus element

Menu