What seems to be the problem:
The main problem is that when I am sending data from the child livewire component to the parent livewire component and put in a public model then the page will refreshing. I would like to have not refreshed the page.
Steps to Reproduce:
Making 2 livewire components and one of them is parent component and second is child component. The child component sending data to the parent component. The parent component will put in a public model and then saving in the database after clicking to the save button.
Are you using the latest version of Livewire:
Yes
Do you have any screenshots or code examples:
Parent.php
public $timelimit_hetfoenabled;
public $timelimit_hetfoblocked;
public $timelimit_hetfostart;
public $timelimit_hetfosend;
protected $listeners = [
'timelimitsetup' => 'timelimitsettings'
];
public function timelimitsettings($enabled, $nap, $blocked, $kezdoido, $vegsoido){
if($nap == 'hetfo'){
$this->timelimit_hetfoenabled = $enabled;
$this->timelimit_hetfoblocked = $blocked;
$this->timelimit_hetfostart = $kezdoido;
$this->timelimit_hetfosend = $vegsoido;
}
}
Child.php:
public $timelimit_hetfoenabled;
public function mondayclick(){
$this->emit('timelimitsetup', $this->timelimit_hetfoenabled, 'hetfo', false, null, null);
}
So how I can prevent to update the page after sent the data to the parent component? I know there is “defer” but that is in the blade part and not in the backend part.
Thanks for answers in advance.