Currently, I have a closely connected pair of parent-child components utilizing a scoped slot. The child component sends data to the parent through a scoped slot prop (which we'll refer to as myScopedProp). Everything is functioning smoothly in this setup. Within the parent's scoped slot, I am able to pass myScopedProp as an argument to various methods in the parent script and it works perfectly.
Now, my question is: How can I access myScopedProp within a computed function defined in the parent component without having to first set it as data? Is there a Vue.js native way to retrieve myScopedProp from the parent script?
<!-- parent -->
<template>
<child>
<template #theSlot="{ myScopedProp}">
{{ parentMethod(myScopedProp) }} <-- this works fine
</template>
</child>
</template>
<!-- child -->
<template>
<slot name="theSlot" :myScopedProp="someChildValue">
</slot>
</template>
So far, I have been resolving this issue by passing a method from the parent to the child which then sets the value of myScopedProp in the parent's data. However, this approach feels incorrect and redundant considering that the value is already being passed via the scoped slot.