From fee1d7d819809ce2c7b26e928c4048f2ca5331c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Thu, 13 Apr 2023 10:32:51 +0200 Subject: [PATCH 1/2] Don't overwrite router-link href in NcBreadcrumb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- src/components/NcBreadcrumb/NcBreadcrumb.vue | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/NcBreadcrumb/NcBreadcrumb.vue b/src/components/NcBreadcrumb/NcBreadcrumb.vue index b3b142d5fd..7feec463f0 100644 --- a/src/components/NcBreadcrumb/NcBreadcrumb.vue +++ b/src/components/NcBreadcrumb/NcBreadcrumb.vue @@ -41,11 +41,8 @@ This component is meant to be used inside a Breadcrumbs component. @dragleave="dragLeave"> From 751153384e16117f457a34f35ab0c87cd420e66c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Thu, 13 Apr 2023 11:31:49 +0200 Subject: [PATCH 2/2] Move expression from template to computed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- src/components/NcBreadcrumb/NcBreadcrumb.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/NcBreadcrumb/NcBreadcrumb.vue b/src/components/NcBreadcrumb/NcBreadcrumb.vue index 7feec463f0..a14336d015 100644 --- a/src/components/NcBreadcrumb/NcBreadcrumb.vue +++ b/src/components/NcBreadcrumb/NcBreadcrumb.vue @@ -42,7 +42,7 @@ This component is meant to be used inside a Breadcrumbs component. @@ -201,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: { /**