I have a Vue component that contains a form that will send an email.
I am having an issue with displaying a default value in the input field. When the page loads I want the email input field to display the user's default email address and only change the value if the user over-writes it with a new email.
I know you can't have v-bind and v-model on the same <input> so how would I go about accomplishing this task?
<input
v-model="emailAddress"
:value="emailAddress"
type="email"
name="email"
id="email-field"
/>
export default {
props: { defaultEmail: String },
data() {
return {
emailAddress: this.defaultEmail || ''
};
}
}