Skip to content

[Feature Request] <ModalLink> custom tag: let pass a Component in addition to String #155

@empresarrollo

Description

@empresarrollo

Environment Details

  • PHP Version: 8.3
  • Laravel Version: 12.27.0
  • React or Vue Version: Vue 3.5.21
  • Inertia.js Version: @inertiajs/[email protected]
  • Inertia Modal Version: @inertiaui/[email protected] -> .\vendor\inertiaui\modal\vue

Feature Request

What feature would you like to see?

It would be great to let use the "as" prop on ModalLink with a component instead of String.
That way you can use something like <ModalLink :as="Button"....> to use a shadcn-vue Button. Now kinda works, but gives a warning: [Vue warn]: Invalid prop: type check failed for prop "as". Expected String with value "[object Object]", got Object

Why is it needed?

To use as a button any component you have

Alternatives Considered

As I said, this works, but gives you a warning:

<ModalLink
  :as="Button"
  :href="route('config.documents.create')"
  class="flex items-center @lg:order-2"
  #default="{ loading }"
  variant="secondary" 
>
    <Plus v-if="!loading" class="w-4 h-4 mr-2" />
    <LoaderCircle v-if="loading" class="h-4 w-4 animate-spin mr-2" />
    New Document
</ModalLink>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions