Skip to content

Commit

Permalink
enh: added option to render icon and text for breadcrumb
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
  • Loading branch information
emoral435 committed Feb 6, 2024
1 parent 7b46f6d commit 6788751
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/components/NcBreadcrumb/NcBreadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@ Renders a button element when given no redirection props, otherwise, renders <a/
@dragover.prevent="() => {}"
@dragenter="dragEnter"
@dragleave="dragLeave">
<NcButton v-if="(name || icon) && !$slots.default"
<NcButton v-if="(name || icon || $slots.icon) && !$slots.default"
:title="title"
:aria-label="icon ? name : undefined"
type="tertiary"
v-bind="linkAttributes"
v-on="$listeners">
<template v-if="iconText" #default>
{{ iconText }}

Check warning on line 50 in src/components/NcBreadcrumb/NcBreadcrumb.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Multiple spaces found before 'iconText'
</template>
<template v-if="$slots.icon || icon" #icon>
<!-- @slot Slot for passing a material design icon. Precedes the icon and name prop. -->
<slot name="icon">
Expand Down Expand Up @@ -144,6 +147,15 @@ export default {
default: '',
},

/**
* Accompanying icon text to make breadcrumb a icon and text button.

Check failure on line 151 in src/components/NcBreadcrumb/NcBreadcrumb.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Trailing spaces not allowed
* Has to have the icon prop / slot defined, otherwise use name prop
*/
iconText: {
type: String,
default: '',
},

/**
* Disable dropping on this breadcrumb.
*/
Expand Down

0 comments on commit 6788751

Please sign in to comment.