Skip to content

Commit

Permalink
Added test to exclude blank breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bradley committed Jun 12, 2020
1 parent cb70e36 commit 88a296c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ class VueBreadcrumbs implements PluginObject<ComponentOptions<Vue>> {
},
this.$breadcrumbs.map((crumb: RouteRecord, index: number) => {
if (crumb?.meta?.breadcrumb) {
if (!(typeof crumb?.meta?.breadcrumb === 'string' && crumb?.meta?.breadcrumb === '')) {
if (typeof crumb?.meta?.breadcrumb === 'string' && crumb?.meta?.breadcrumb === '') {
console.log('Breadcrumb blank. Ignoring');
} else {
console.log('Breadcrumb valid', crumb?.meta?.breadcrumb);
return createElement(
'li',
{
Expand Down

0 comments on commit 88a296c

Please sign in to comment.