I handle this by initializing the value of my model with the value of an input field. Thus, when vue initially sets the input field to the model value, this is the value that was in the input field.
Example below using jquery:
<div id="update-email"> <input id="email" type="text" name="email" value=" me@example.com " v-model="email"> {{ email }} </div>
Javasacript:
new Vue({ el: '#update-email', data() { return { email: $('#email').val(), }; } });
If you want to do this without jquery, just change $('#email').val() to document.getElementById('email').value
Ron c source share