simonmarcellinden / laravelmultiselect
基于 Vue 的多选组件
2.1.1
2021-06-08 07:20 UTC
Requires
- illuminate/support: ~7|~8
- simonmarcellinden/helperpackage: ^1.0.0
Requires (Dev)
- orchestra/testbench: ~5|~6
- phpunit/phpunit: ~9.0
README
这里应该放你的描述。查看 contributing.md 了解待办事项列表。
安装
通过 Composer
$ composer require simonmarcellinden/laravelmultiselect
运行以下命令安装所有必需文件
$ php artisan multiSelect:install
Laravel <= 5.4
安装 LaravelMultiSelect 后,您需要将服务提供者注册到应用程序中。打开 config/app.php 并找到 providers 键。
将服务提供者添加到 config/app.php
SimonMarcelLinden\LaravelMultiSelect\LaravelMultiSelectServiceProvider::class,
可选地,如果您想包括 Facade,也可以将其添加到 config/app.php。
"LaravelMultiSelect" => "SimonMarcelLinden\LaravelMultiSelect\Facades\LaravelMultiSelect::class",
发布配置
从项目的根目录运行以下命令
$ no config needed
配置文件将被发布到 config/scriptloader.php。
使用方法
将以下代码片段添加到您的视图中
<?php <x-multiSelect :values="$labels" /> ?>
或使用以下代码片段来预选标签
<?php <x-multiSelect :values="$values" :preSelect="$preSelect" /> ?>
并在控制器中定义用于显示的标签
<?php namespace App\Http\Controllers; class HomeController extends Controller { public function index() { // Defaults labels $labels = [ ['key' => '34123' , 'label' => 'License'], ['key' => '34124' , 'label' => 'GitHub Stars'], ['key' => '34125' , 'label' => 'Npm Monthly Downloads'], ['key' => '34126' , 'label' => 'Full Test Coverage'], ['key' => '34127' , 'label' => 'No Dependencies'], ['key' => '34128' , 'label' => 'Lorem Ipsum'], ['key' => '34129' , 'label' => 'AllPCB'], ['key' => '34130' , 'label' => 'DevTools'], ['key' => '34131' , 'label' => '@Deprecated'], ['key' => '34132' , 'label' => 'VueJS'], ['key' => '34133' , 'label' => 'Laravel'], ]; return view('welcome', ['labels' => $labels]); } } ?>
变更日志
请查看 changelog 了解最近的变化。
贡献
请查看 contributing.md 了解详细信息及待办事项列表。
安全性
如果您发现任何安全问题,请发送电子邮件到 inof@snerve.de 而不是使用问题跟踪器。
致谢
许可
MIT。请参阅 许可文件 获取更多信息。