1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Livewire not rendering slots

Discussão em 'Outras Linguagens' iniciado por Donny van V, Outubro 9, 2024 às 09:12.

  1. Donny van V

    Donny van V Guest

    I'm trying to create a table and make the actions column flexible. I thought it is handy to use a slot for the actions so I can change it whenever the actions change. So my goal basically:

    <livewire:tables.products.overview>
    <x-slot:slotName>
    Some data here
    </x-slot:slotName>
    </livewire:tables.products.overview>


    In the overview, I got a empty page with just the slot I want to render:

    <div>
    Render the slot here: -> {{$slotName}} <-
    </div>


    Running this template, causes the error Undefined variable $slotName.

    I decided to go back to basics and changed the overview.blade.php with just the default slot:

    <div>
    Render the slot here: -> {{$slot}} <-
    </div>


    Then render the template as:

    <livewire:tables.products.overview>
    <div>
    My slot will be placed here
    </div>
    </livewire:tables.products.overview>


    Also this gives me a error: Undefined variable $slot

    What am I missing, what is it that I'm not seeing?

    Continue reading...

Compartilhe esta Página