Laravel Livewire 搜索自动完成,就像 google 搜索一样,使用键盘箭头键选择,然后按 Enter 键进行选择
Laravel Livewire 搜索自动完成,就像 google 搜索一样,使用键盘箭头键选择,然后按 Enter 选择
这里是我的代码
use Livewire\Component;
class SearchUsers extends Component
{
public $search = '';
public function render()
{
return view('livewire.search-users', [
'users' => User::where('username', $this->search)->get(),
]);
}
}
<div>
<input wire:model="search" type="text" placeholder="Search users..."/>
<ul>
@foreach($users as $user)
<li>{{ $user->username }}</li>
@endforeach
</ul>
</div>
,但不起作用 lkie google 搜索想要按名称创建 POS 销售发票搜索,并使用键盘按 id 选择产品
Laravel Livewire search auto complete like google search select with keyboard arrow key and hit enter to select
here is my code
use Livewire\Component;
class SearchUsers extends Component
{
public $search = '';
public function render()
{
return view('livewire.search-users', [
'users' => User::where('username', $this->search)->get(),
]);
}
}
<div>
<input wire:model="search" type="text" placeholder="Search users..."/>
<ul>
@foreach($users as $user)
<li>{{ $user->username }}</li>
@endforeach
</ul>
</div>
but work not lkie google search want to create POS sale invoice search by name and select product by id using keyboard
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论