-
Notifications
You must be signed in to change notification settings - Fork 342
Closed
Labels
Description
After a whole day of debugging, I found a problem with passing ref to a grandchild element in vue 3.
Basically, my setup is like this:
Form
-> CustomInput
-> Input
in Form
, when I use ref
, I want it to refer to Input
.
<template>
<custom-input ref="address"/>
</template>
<script>
setup(props, context) {
const address = ref();
const { initAutoComplete } = useGoogleMaps();
onMounted(() => {
initAutoComplete(address.value);
});
return {
address,
};
},
</script>
Right now, the value of address.value
is undefined.
How can I solve this? Please give example.
Thank you.