Menu
×
×
Correct!
Exercise:What directives are needed to provide data from a components slot to the parent?
Local data in a component is sent from a slot with v-bind,
and it can be received in the parent with v-slot.
CompOne.vue:
<slot v-bind:lclData="data"></slot>
App.vue:
<comp-one v-slot:"dataFromSlot">
<h2>{{ dataFromSlot.lclData }}</h2>
</comp-one>
Local data in a component is sent from a slot with v-bind,
and it can be received in the parent with v-slot.
CompOne.vue:
<slot :lclData="data"></slot>
App.vue:
<comp-one v-slot:"dataFromSlot">
<h2>{{ dataFromSlot.lclData }}</h2>
</comp-one>
Not CorrectClick here to try again. Correct!Next ❯Local data in a component is sent from a slot with, and it can be received in the parent with . CompOne.vue: <slot :lclData="data"></slot> App.vue: <comp-one :"dataFromSlot"> <h2>{{ dataFromSlot.lclData }}</h2> </comp-one> |