josedaian/select2wire
最新稳定版本:v2.0.1
Composer 安装命令:
composer require josedaian/select2wire
包简介
Select2 for livewire components.
README 文档
README
Laravel package for handling Select2 inputs for Livewire components.
Requirements
Quick Installation
composer require josedaian/select2wire
For Livewire 2.x version, go here: select2wire v1.x
Usage
Add the following line within your blade view, below the select2.js and jquery.js scripts
@select2wireScript
Within your Livewire component class, call the trait to do one of the functions when loading the component.
use Livewire\Component; use JoseDaian\Select2\Traits\HasSelect2Wire; class ExampleComponent extends Component { use HasSelect2Wire; }
If you don’t have a custom init event, you can call the initSelect2 event directly within your component view.
<div wire:init="initSelect2"> ... <!-- All your selects here --> </div>
Or in case you already have an init event inside your component, just add the following line
public function customInitFunction() { // your code $this->initSelect2(); }
And within your blade view, you’ll need to add the data-select2wire="select2" attribute to your inputs select.
<select data-select2wire="select2"> <!-- options --> </select>
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email josedaian.cabrera@gmail.com instead of using the issue tracker.
Credits
Acknowledgments
This package was inspired by livewire-select2.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 131
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-10-28