يضيف Livewire v4 دعمًا لتمرير خصائص HTML إلى المكونات.
الاستخدام
<wire:alert type="error" class="mb-4" id="error-alert">
حدث خطأ ما!
</wire:alert>المكون
@php
new class extends Livewire\Component {
#[Prop]
public string $type = 'info';
}
@endphp
<div {{ $attributes->merge(['class' => 'alert alert-'.$type]) }}>
{{ $slot }}
</div>