I am facing an issue with accessing properties that I pass to my slot, as my slotProps
are returning undefined.
Despite carefully reading the Vue docs and being new to Vue, I am unable to understand why I am unable to access the props data.
The Issue
While attempting to retrieve the slotProps
in my child component's created
hook, it is coming back as undefined.
This problem needs attention.
<template>
<div>
<slot :data="data" :loading="loading"></slot>
</div>
</template>
Child Component
<template v-slot:default="slotProps">
<div>
</div>
</template>
<script>
export default {
name: "child",
created: function() {
console.log("slotProps", slotProps);
}
};
</script>