Skip to content

Commit

Permalink
Merge pull request #3973 from nextcloud/fix/noid/breadcrumb-router-href
Browse files Browse the repository at this point in the history
  • Loading branch information
raimund-schluessler authored Apr 13, 2023
2 parents f7dfdda + 7511533 commit 0b66d10
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/NcBreadcrumb/NcBreadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,8 @@ This component is meant to be used inside a Breadcrumbs component.
@dragleave="dragLeave">
<component :is="tag"
v-if="(nameTitleFallback || icon) && !$slots.default"
:exact="exact"
:to="to"
:href="href"
:title="title"
v-bind="$attrs"
v-bind="linkAttributes"
v-on="$listeners">
<!-- @slot Slot for passing a material design icon. Precedes the icon and title prop. -->
<slot name="icon">
Expand Down Expand Up @@ -204,6 +201,14 @@ export default {
tag() {
return this.to ? 'router-link' : 'a'
},
/**
* The attributes to pass to `router-link` or `a`
*/
linkAttributes() {
// If it's a router-link, we pass `to` and `exact`, otherwise only `href`
return this.to ? { to: this.to, exact: this.exact, ...this.$attrs } : { href: this.href, ...this.$attrs }
},
},
methods: {
/**
Expand Down

0 comments on commit 0b66d10

Please sign in to comment.