Skip to content

Breadcrumb ​

Basic Usage ​

vue
<template>
  <VBreadcrumb :items="['Home', 'Orders', 'Detail']" />
</template>

Clickable Ancestors ​

Ancestor items emit select with their index and the full item. The last item is the current page and is not selectable.

H5 renders ancestors with href as anchors. Weapp has no page-level <a>, so the same field is only forwarded on select; the page owns wx.navigateTo or routing.

vue
<script setup lang="ts">
const items = [
  { href: '/', label: 'Home' },
  { href: '/orders', label: 'Orders' },
  { label: 'Detail' },
]
</script>

<template>
  <VBreadcrumb :items="items" @select="console.log" />
</template>

Props ​

PropTypeDefaultDescription
itemsArray<string | BreadcrumbItem>[]Trail items
labelstring'Breadcrumb'Accessible nav label
separatorstringchevron iconCustom separator; defaults to icon

BreadcrumbItem: { label: string, href?: string, disabled?: boolean, value?: string }. href becomes a link on H5 and is not auto-navigated on Weapp.

Events ​

EventPayloadDescription
select{ index: number, item: BreadcrumbItem }Fired for a non-current crumb

Slots ​

SlotDescription
itemCustom crumb content
separatorCustom separator content