Home > front end >  add element or symbol to a :value
add element or symbol to a :value

Time:08-25

I have two input text which, its :value is a value that is in a state in a store, I have two inputs, and in the store an array with two elements, where it assigns one to each input and shows it to me, but I want add a symbol either % or some text at the end of the input, how can I do it, can this be added in the :value?

<input 
 type="text" 
  
 :value="filtersStore.absorptionValue[0]"
 @input="event => filtersStore.handleAbsortionValue(event.target.value)"
>
                                        
                                        

in the input value I want to add the text or the symbol

CodePudding user response:

You can use template literals with Vue's data bindings, e.g. to append a percent sign:

:value="`${filtersStore.absorptionValue[0]}%`"
  • Related