Skip to content

Commit e629ce0

Browse files
committed
Add inertia-vue version directory placeholders
1 parent 647652d commit e629ce0

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

.ai/inertia-vue/1/.gitkeep

Whitespace-only changes.

.ai/inertia-vue/2/.gitkeep

Whitespace-only changes.

.ai/livewire/3/core.blade.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
#### Key Changes from Livewire 2
3+
4+
- **Namespace**: Components now use `App\Livewire` (not `App\Http\Livewire`)
5+
- **Events**: Use `$this->dispatch()` (not `emit` or `dispatchBrowserEvent`)
6+
- **Layout path**: `components.layouts.app` (not `layouts.app`)
7+
- **Deferred by default**: Use `wire:model.live` for real-time updates
8+
- **Alpine included**: Don't manually include Alpine.js
9+
10+
#### Livewire Best Practices
11+
12+
- **Single root element** in Blade components
13+
- **Add wire:key** in loops:
14+
15+
@verbatim
16+
```blade
17+
@foreach ($items as $item)
18+
<div wire:key="item-{{ $item->id }}">
19+
{{ $item->name }}
20+
</div>
21+
@endforeach
22+
```
23+
@endverbatim
24+
25+
- **Use attributes** for event listeners:
26+
27+
```php
28+
#[On('todo-created')]
29+
public function refreshList()
30+
{
31+
// ...
32+
}
33+
```
34+
35+
- **Loading states**: Use `wire:loading` and `wire:dirty`
36+
- **Confirmations**: Use `wire:confirm="Are you sure?"`

0 commit comments

Comments
 (0)