zys / livewire-alert
livewire alert 组件
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 1
Language:Blade
Requires
- laravel/framework: ^8.0
- livewire/livewire: ^2.0
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-05-06 19:17:08 UTC
README
livewire alert 组件.
Installing
$ composer require zys/livewire-alert -vvv
Requirements
This package uses Livewire under the hood. Please make sure you include it in your dependencies before using this package.
- PHP 7.2 or higher
- Laravel 8
- Livewire
- tailwindcss
Usage
Add livewire-alert component
<body> ... @livewire('livewire-alert') </body>
Show message in livewire component
public function showMessage() { ... $this->alert('info', 'Message~', ['content' => 'Message Content', 'timeout' => 3000]); }
Show Message in javascript
window.livewire.emitTo('livewire-alert', 'livewireAlert', { type: 'info', message: 'Message', options: { content: 'Message content~', timeout: 3000, } })
Contributing
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
License
MIT