From 15755af38e50b9c317e1522dc40d0569883cc6de Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Wed, 14 Dec 2022 18:15:18 -0800 Subject: [PATCH] Allow intermediary breadcrumbs to not be links. --- docs/pages/kbreadcrumbs.vue | 15 +++++++++++++++ lib/KBreadcrumbs.vue | 15 +++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/docs/pages/kbreadcrumbs.vue b/docs/pages/kbreadcrumbs.vue index cd21fa1ac..c00bfcf90 100644 --- a/docs/pages/kbreadcrumbs.vue +++ b/docs/pages/kbreadcrumbs.vue @@ -47,6 +47,21 @@ /> + +
+ Links to intermediary items can be disabled by omitting the link attribute, or making it falsey. + + + + +
diff --git a/lib/KBreadcrumbs.vue b/lib/KBreadcrumbs.vue index 0cae6b060..72c746152 100644 --- a/lib/KBreadcrumbs.vue +++ b/lib/KBreadcrumbs.vue @@ -27,6 +27,7 @@ class="breadcrumbs-dropdown-item" > {{ text }} + {{ crumb.text }} @@ -49,6 +51,7 @@ class="breadcrumbs-visible-item breadcrumbs-visible-item-notlast" > {{ text }} + {{ crumb.text }}
  • Boolean(crumb.text))) { return false; } - // All, but the last, must have a valid router link - return crumbItems.slice(0, -1).every(crumb => validateLinkObject(crumb.link)); + // If link is truthy make sure it is a valid router link + return crumbItems.every(crumb => !crumb.link || validateLinkObject(crumb.link)); }, }, /**