Skip to content

Commit

Permalink
fix(Breadcrumb): render as nav
Browse files Browse the repository at this point in the history
Resolves #2649
  • Loading branch information
benjamincanac committed Nov 15, 2024
1 parent 8ed434c commit 756f791
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 45 deletions.
3 changes: 2 additions & 1 deletion src/runtime/components/Breadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface BreadcrumbItem extends Omit<LinkProps, 'raw' | 'custom'> {
export interface BreadcrumbProps<T> {
/**
* The element or component this component should render as.
* @defaultValue 'div'
* @defaultValue 'nav'
*/
as?: any
items?: T[]
Expand Down Expand Up @@ -88,6 +88,7 @@ import ULinkBase from './LinkBase.vue'
import ULink from './Link.vue'
const props = withDefaults(defineProps<BreadcrumbProps<T>>(), {
as: 'nav',
labelKey: 'label'
})
const slots = defineSlots<BreadcrumbSlots<T>>()
Expand Down
1 change: 1 addition & 0 deletions test/components/Breadcrumb.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe('Breadcrumb', () => {
it.each([
// Props
['with items', { props }],
['with as', { props: { ...props, as: 'div' } }],
['with labelKey', { props: { ...props, labelKey: 'icon' } }],
['with separatorIcon', { props: { ...props, separatorIcon: 'i-lucide-minus' } }],
['with class', { props: { ...props, class: 'w-48' } }],
Expand Down
Loading

0 comments on commit 756f791

Please sign in to comment.