eym
eym
NNuxt
Created by eym on 10/13/2024 in #❓・help
using ref alongside conditional rendering (useTemplateRef + v-if)
I fixed it. It was because the useTemplateRef is initialized before the component actually gets rendered so it is undefined at first. I used a watcher on the useTemplateRef and the interesting part is that it is reactive.
watch(VerifyMobileRef, () => {
VerifyMobileRef.value?.startCountdown();
});
watch(VerifyMobileRef, () => {
VerifyMobileRef.value?.startCountdown();
});
3 replies