Hi,
Here is my markup.
<div class="btn-group btn-group-sm btn-group-toggle" data-toggle="buttons">
<label class="btn btn-outline-primary" title="Display as a list">
<input type="radio" wire:click="toggleView" name="options" id="option1" autocomplete="off"/> <i
class="fa fa-list"></i>
</label>
<label class="btn btn-outline-primary" title="Display as a grid">
<input type="radio" wire:click="toggleView" name="options" id="option2" autocomplete="off"/> <i
class="fa fa-th-large"></i>
</label>
</div>
and here is class
class ContactApp extends Component
{
public $viewMode = 'list';
public function toggleView() {
$this->viewMode = "grid";
}
public function render()
{
return view('livewire.contact-app');
}
}
The problem is its not invoking the function. If I use normal <button wire:click="toggleView">Gird</button>
It works, but not working with radio inputs