【发布时间】:2021-05-14 18:54:54
【问题描述】:
我有非常简单的 livewire 渲染功能,但数据在一秒钟后从刀片中消失。
component
public function render()
{
$spotlight = Project::orderby('created_at', 'desc')->where('published', '=', 'y')->with('user')->offset(5)->take(5)->latest()->get();
return view('livewire.index.job-spotlight', compact('spotlight'));
}
view
<div>
<h3 class="margin-bottom-5">Panel name</h3>
<div id="job-spotlight" class="showbiz-container">
<div class="showbiz" data-left="#showbiz_left_1" data-right="#showbiz_right_1" data-play="#showbiz_play_1" >
<div class="overflowholder">
<ul>
@foreach($spotlight as $spots)
<li wire:poll.keep-alive>
{{$spots->title}}
</li>
@endforeach
</ul>
</div>
</div>
</div>
</div>
注意::<li> 标签上有一个wire:poll.keep-alive。
有什么想法吗?
【问题讨论】: