Hey I have a example for you :
component child:
<script setup lang="ts">
const emit = defineEmits(['update:email','update:password'])
const handleEmail = (event: Event) => {
const target = event.target as HTMLFormElement
emit('update:email', target.value)
}
const handlePassword = (event: Event) => {
const target = event.target as HTMLFormElement
emit('update:password', target.value)
}
</script>
<template>
<div class="loginContainer">
<input type="email" placeholder="Email address" @input="handleEmail" />
<Divider/>
<input type="password" placeholder="Password" @input="handlePassword" />
</div>
</template>
component parent:
template:
<template>
<div class="background">
<span class="title">Sign in to ConnectCALL</span>
<div style="display: flex; flex-direction: column; gap: 20px; width: 500px; margin: 20px;">
<FormsEmailAndPassword @update:email="handleEmail" @update:password="handlePassword" />
<div style="text-align: end;">
<ButtonLinkButton title="Forgot Password?" @click="redirectToRecoverPage" :isLoading="isLoading" />
</div>
<ButtonRegularButton title="Sign In" @click="initAuth" :isLoading="isLoading" />
<ButtonRegularButton title="Register" variant="secondary" @click="redirectToSignUp" backgroundColor="white" :isLoading="isLoading" />
</div>
</div>
</template>
script:
const handleEmail = (value: string) => {
email.value = value
}
const handlePassword = (value: string) => {
password.value = value
}
I hope thats help you