I have an element
<input
type="text"
class="text-[16px] text-light-text bg-main-background p-[11px]"
name="email"
ref="email"
:value="emailInput"
@keyup.enter="checkEmailAndSendCode"
/>
Now I want to assign prop data once to it
let emailInput = ref<string>("")
emailInput.value = props.form_data.email
Now I want to update it and show confirmation code block
const checkEmailAndSendCode = () => {
// TODO: check email
console.log('we are sending email: ', emailInput.value)
// Require code for the new email entered
requireEmailCode(emailInput.value);
// Show email code block
state.email.isNewEmailEntered = true;
};
Result: when I press Enter the emailInput is again populated not by the changed email but by email in props.form_data.email and old email is sent. Console.log shows value from props.form_data.email and not the email I input into form
What I want: I want emailInput to be populated from props only on start