Use the footer slot’s own click handler with event modifiers to stop the card’s link navigation from handling clicks inside the footer.
In your example, add both .stop and .prevent on the button (or a wrapper in the footer) so the event doesn’t bubble to UPageCard’s internal NuxtLink:
<UPageCard
to="<https://github.com/keebdex/keebdex">
target="_blank"
title="Keebdex"
>
<template #footer>
<div @click.stop.prevent>
<UButton
icon="i-simple-icons-github"
@click="
() => {
alert(10000)
}
"
>
I wanna click here
</UButton>
</div>
</template>
</UPageCard>
Rationale:
- UPageCard accepts NuxtLink props (to/target) and becomes a clickable card. Use slots like footer to place interactive content. Stopping and preventing the click in that slot prevents the card’s link from triggering, similar to the recommended pattern for nested links where you avoid nested anchors and use a non-link element with @click.prevent/.stop instead (PageCard API/slots, Button as link props, and the nested-link guidance/workaround: use a div with @click.prevent inside a link container (Stack Overflow answer)).
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: