Laravel Livewire component not refreshing/reloading automatically after refreshing it

后端 未结 1 1420
青春惊慌失措
青春惊慌失措 2020-12-11 16:20

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 ,

相关标签:
1条回答
  • 2020-12-11 16:49

    So it seems I've write my component blade view in wrong way.

    all things on refreshed component should be wrapped in one div element like this:

    <div> 
    {{-- Anything you want to do --}}
    
    </div>  
    

    previously my blade file was like. Which is Wrong

    <div class=""> 
     {{ -- some dom elements -- }}
    </div>
    
    <div class=""> 
    {{ -- some other dom elements -- }}
    </div>
    
    

    but that should be like.

    <div>
        <div class=""> 
           {{ -- some dom elements -- }}
        </div>
    
        <div class=""> 
        {{ -- some other dom elements -- }}
        </div>
    </div>
    
    

    So Whatever you write, that should be inside ONE PARENT DIV ELEMENT

    0 讨论(0)
提交回复
热议问题