During the creation of a password changing form, I encountered an issue with the browser's autocomplete feature interfering. To prevent this, you can use the following method to customize the value as needed.
When trying to set a field as readonly using v-bind:readonly property with true, it ends up being rendered as readonly="readonly".
Below is a solution that effectively toggles the readonly property on focusout event.
Implementing in Vue Template HTML
<input type="password" v-model="user.password" placeholder="Password" @focusin="toggleReadonly" @focusout="toggleReadonly" :readonly="true">
Toggle Method
toggleReadonly(event){
event.preventDefault()
if(event.target.getAttribute('readonly') == 'readonly'){
event.target.removeAttribute('readonly')
}
else{
event.target.setAttribute('readonly', 'readonly')
}
}