Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for onClick event on Breadcrumb items #3631

Open
jrutila opened this issue Mar 20, 2025 · 0 comments
Open

Support for onClick event on Breadcrumb items #3631

jrutila opened this issue Mar 20, 2025 · 0 comments
Labels
enhancement New feature or request triage v3 #1289

Comments

@jrutila
Copy link
Contributor

jrutila commented Mar 20, 2025

Description

Breadcrumb uses Link (and LinkBase) to implement the item rendering and navigation. Link (through LinkBase) in itself supports onClick event/prop. Now, passing onClick to the breadcrumb item does not go all the way through to the LinkBase, and thus prevents the fine-grained control of the Breadcrumb component.

The usage would look something like this:

<template>
 <UBreadcrumb :items="items" />
</template>
<script setup>
const items = [
 { label: "click for one", onClick: () => alert("1"), to: "/one" },
 { label: "click for two", onClick: () => alert("2"), to: "/two" },
]
</script>

My need is to have some secondary effects happening besides the navigation when the user clicks on a breadcrumb item.

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage v3 #1289
Projects
None yet
Development

No branches or pull requests

1 participant