public bool $triggerModal = false;
public $cols = [];
public $selectedColumn = null;
#[On('triggerModal')]
public function triggerModal(int $importFileId)
{
$this->selectedColumn = 3;
$this->cols = [0,1,2,3,4,5];
$this->triggerModal = true;
}
<div>
<label class="block text-sm font-medium leading-6 text-gray-900">Name</label>
<select wire:model='selectedColumn'>
<option value="">(Select Column)</option>
@foreach ($cols as $col)
<option value="{{ $col }}">{{ $col }}</option>
@endforeach
</select>
</div>
Name Col: {{ $nameColumn }}
Very basic livewire component,
First the columns array
is empty but then I’m just setting the cols and the data which is selected. The data is in the variable I can see. but the select is not bonded. The select is not selected to 3. But the variables have the perfect data.
Added wire:key all over the select foreach etc. and tried also.