laravel-livewire

Laravel Livewire component not refreshing/reloading automatically after refreshing it

主宰稳场 提交于 2020-05-15 02:08:12
问题 So, I'm currently using Laravel Livewire in one of my projects. But when I try emit an event from one component to another component by magic mathod $refresh , its refreshing (got the dom in xhr request ) the total component but the Front end is not updating realtime. ProductReviewForm.php Component public function save() { //some functionalities .... $this->emit('reviewSectionRefresh'); } ProductReviewSection.php Component protected $listeners = [ 'reviewSectionRefresh' => '$refresh', ];

laravel livewire, how to pass the id or data to another component by click

∥☆過路亽.° 提交于 2020-03-21 20:57:59
问题 I have two components Posts and Post, Posts show the posts and by clicking the image I want to show the data of clicked post in another component. Posts class and component down below: Component View: <div class="post" x-data="{open:false}"> @foreach($posts as $post) <div> <h1>{{ $post->name }}</h1> <h3>{{ $post->body }}</h3> <img @click="open = !open" wire:click="showPost({{ $post->id }})" src="{{ $post->image }}" alt=""> </div> @endforeach <livewireL:post> </div> Component Class: class

laravel livewire, how to pass the id or data to another component by click

随声附和 提交于 2020-03-21 20:57:12
问题 I have two components Posts and Post, Posts show the posts and by clicking the image I want to show the data of clicked post in another component. Posts class and component down below: Component View: <div class="post" x-data="{open:false}"> @foreach($posts as $post) <div> <h1>{{ $post->name }}</h1> <h3>{{ $post->body }}</h3> <img @click="open = !open" wire:click="showPost({{ $post->id }})" src="{{ $post->image }}" alt=""> </div> @endforeach <livewireL:post> </div> Component Class: class

laravel livewire, how to pass the id or data to another component by click

我怕爱的太早我们不能终老 提交于 2020-03-21 20:56:38
问题 I have two components Posts and Post, Posts show the posts and by clicking the image I want to show the data of clicked post in another component. Posts class and component down below: Component View: <div class="post" x-data="{open:false}"> @foreach($posts as $post) <div> <h1>{{ $post->name }}</h1> <h3>{{ $post->body }}</h3> <img @click="open = !open" wire:click="showPost({{ $post->id }})" src="{{ $post->image }}" alt=""> </div> @endforeach <livewireL:post> </div> Component Class: class