You cannot. Laravel has completed its work before Vue ever begins.
Jun 29, 2023
2
Level 4
Passing props from Vue slot to Laravel component
I have this Vue component, called the-collapsible, and inside it I can have a slot and pass to my slot an image called image. In this specific case of my example, I have a Laravel component that should receive my image from the slot, but I simply can't make it work . So far I've tried:
:image="{{ image }}"
image="{{ image }}"
:image="image"
image="image"
and none worked, so I'd like to know what's the proper way to pass a prop from the the vue component to the slot (laravel component) in this case.
Example: somewhere inside blade
<the-collapsible child_key="item" :parents="product.accompaniment_categories" v-slot="{ image }">
<x-card
:image="image"
:text="$product->title"
:route="$product->route"
disabled-badge="{{ $product->quantity > 0 ? false : 'Esgotado' }}"
first-badge="{{ 'R$' . $product->price }}"
image-mode="contain"
second-badge="{{ $product->category->restaurant->configurations?->external ? 'Delivery' : false }}"
:description="$product->description"
/>
</the-collapsible>
Level 104
2 likes
Please or to participate in this conversation.