How to use v-model even if user does not edits the input value?

104 Views Asked by At

I am just learning vue.js.

I have an input, where I want to have already filled field value="{{ current_user.rbe.main_contact_person }}". The user should be able to edit the value. I am trying to send the data with v-model. It only works if an user edits something, but if not it will send nothing.

How could I send the value to database even if it is not edited?

I am using jinja2 and that's why I am using curly bracketsvalue="{{ current_user.rbe.main_contact_person }}".

             <input 
                class="fieldInput"
                placeholder= "{{ current_user.rbe.main_contact_person }}"
                value="{{ current_user.rbe.main_contact_person }}"
                v-model="newContract.name"
              >
1

There are 1 best solutions below

0
On

you don't need the value. simply give the value of {{ current_user.rbe.main_contact_person }} to newContract.name.