Is it possible to create custom Breadcrumbs with click handlers in Vuetify 3? #16895
-
Hi all, For example, my app has a nested structure of:
I'd like to have a click-handler on each level, so that I can do the appropriate actions to take the user to that level (sadly, a URL is not going to cut it - as I'm managing state manually with Pinia). I've been pouring over the help topic and API, but can't see any mention of click-handling 🤔 I've tried something like the snippet below... <v-breadcrumbs
:items="[
{
title: 'World',
active: true,
},
{
title: 'Scene',
active: true,
},
{
title: 'Prop',
},
]"
>
<template v-slot:divider>
<v-icon icon="mdi-chevron-right"></v-icon>
</template>
</v-breadcrumbs> (I'm using the template as I want to have chevrons ">") ...but
Thanks in advance for any suggestions 🤓 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
For now, I've "faked" it using buttons and icons... <!-- Breadcrumbs -->
<v-btn variant="plain" @click="backToWorldClicked">World</v-btn>
<v-icon icon="mdi-chevron-right"></v-icon>
<v-btn variant="plain" @click="backToSceneClicked">Scene</v-btn>
<v-icon icon="mdi-chevron-right"></v-icon>
<v-btn variant="plain" disabled>Prop</v-btn> It's not quite the same, but I think it'll do me for now. |
Beta Was this translation helpful? Give feedback.
-
Add |
Beta Was this translation helpful? Give feedback.
Add
onClick
to the items objects, or usev-breadcrumbs-item
andv-breadcrumbs-divider
in the default slot instead of the items prop.