0๐
โ
As getCurrentInstance
should normally not been used, you should follow the Template Refs guide.
<!โ- inside the template โ->
<my-modal ref="modalLoading" />
// your component
export default defineComponent({
setup() {
const modalLoading = ref(null);
const handleSubmit = () => {
If(!modalLoading.value) return;
modalLoading.value.openModal();
}
return { modalLoading };
}
})
Source:stackexchange.com