Hi,
I am new to livewire.
I installed the package and did the counter example as per the documentation.
I have added the @livewireAssets
just above the scripts.The counter.blade.php is like below:
div style="text-align: center">
</button wire:click="increment">+</button>
</h1>{{ $count }}</h1>
</button wire:click="decrement">-</button>
div>
(I intentionally removed< in div command to show html code)
and I added to view the counter as below:
@livewire(‘counter’)
and the Counter.php file as below:
<?php
namespace App\Http\Livewire;
use Livewire\Component;
class Counter extends Component
{
public $count = 5;
public function increment()
{
$this->count++;
}
public function decrement()
{
$this->count--;
}
public function render()
{
return view('livewire.counter');
}
}
It shows the initial value. But, when I click on +
or -
symbol, nothing happening.
Can anyone help me to solve this issue?
Or How can I check the click event is reaching the Counter.php function?
Regards,
Manu