Skip to content

How to pass data to Modal? #33

@errand

Description

@errand

It's common situation when user clicks on Delete button and confirmation Modal pops up. But i'm stuck passing id to Modal

<x-splade-data>

      <x-splade-table :for="$tags" class="w-2/3">
          <x-splade-cell actions>
              <Link href="#confirm-delete" @click="state.shared.tag = {{ $item->id }}"> {{__('Delete')}} </Link>
          </x-splade-cell>
      </x-splade-table>

    <x-splade-modal :close-button="false" name="confirm-delete">
        <h1>{{ __('Are you sure') }}?</h1>
        <button type="button" @click="modal.close">{{ __('Cancel') }}</button>
        <Link :href=`/dashboard/tag/${data.tag}/delete`> {{__('Delete')}} </Link>
    </x-splade-modal>

</x-splade-data>

Tried both Data and State. And in both cases there is no data in modal

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions