change view dynamically in a page
Hello,
I've made a page in which I'd like to have tabs.
When I click on a tab, I want to load a different component in my page.
Is it possible to load different component on live like @livewire('components.'.$componentName) ?
I've made a page in which I'd like to have tabs.
When I click on a tab, I want to load a different component in my page.
Is it possible to load different component on live like @livewire('components.'.$componentName) ?
Solution
I found the solution with add key parameter in component :
@livewire('components.'.$componentName, [], key($key))
and in changeTab function, add :
$this->key = random_int(-999, 999);
@livewire('components.'.$componentName, [], key($key))
and in changeTab function, add :
$this->key = random_int(-999, 999);