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

Laravel 10 livewire 3 and select2 are not compatible

Discussão em 'Outras Linguagens' iniciado por softby net, Novembro 5, 2024 às 23:02.

  1. softby net

    softby net Guest

    In the Laravel 10 and Livewire 3 versions I use in my project, I add and update by opening a column in the table. I use select here, but the select2 library does not work here. The code is below as an example.

    @if($addingNewRow)
    <tr>
    <td>
    <input type="text" class="form-control" wire:model="newAllergen" placeholder="Tercih">
    </td>
    <td>
    <select class="form-select select2" wire:ignore wire:model="newDepartment">
    <option value="">Departman Seçiniz</option>
    @foreach(\App\Models\Userdepartmans::where('is_delete',0)->get() as $department)
    <option value="{{ $department->id }}">{{ $department->departman }}</option>
    @endforeach
    </select>
    </td>

    <td style="text-align: right;">
    <button type="button" class="btn-save" wire:click="saveNewRow"><i class="icon-check"></i></button>
    <button type="button" class="btn-cancel" wire:click="cancelNewRow"><i class="icon-close"></i></button>
    </td>
    </tr>
    @endif


    My code is here, this is my work, but select2 does not work

    Continue reading...

Compartilhe esta Página