I'm trying to utilize the emit function in my file called useGoo.ts
import Swal from "sweetalert2/dist/sweetalert2.js";
export default function useModal() {
const { emit } = getCurrentInstance();
function myId() {
emit('id', '123')
}
}
Unfortunately, I can't seem to get the emit function to work. I keep getting this error message:
Property 'emit' does not exist on type 'ComponentInternalInstance | null'