Skip to content

auto-merge class attributes on view components #1477

@brendt

Description

@brendt
        <x-action-button
            :action="uri([TodoController::class, 'postpone'], todo: $todo->id, until: 'tomorrow')"
            class="bg-red-200"
        >

This should work without having to add :class="$class ?? ''" in the view component

<button
    class="bg-gray-100 px-2 py-1 rounded-md text-sm cursor-pointer"
    :class="$class ?? ''"
    :hx-post="$action"
    hx-target="#todo"
>
    <x-slot />
</button>

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions