Breadcrumb
It's hard to associate "breadcrumb" with this UI component at all...
Basic Usage
Use Breadcrumb and BreadcrumbItem to build a breadcrumb navigation bar.
By default, the last item is rendered as plain text. This can be changed via the renderLastText property of Breadcrumb.
BreadcrumbItem renders an option as an <a> tag or a Vue Router RouterLink component based on its href or route property.
WARNING
href and route are directly rendered into the <a> tag. Passing values like javascript:alert(1) or malicious URLs may lead to XSS or open redirect vulnerabilities.
- Home
- >
- Breadcrumb
Disabled and Non-clickable
Use the disabled property of BreadcrumbItem to disable an item, and clickable to control whether a child item is clickable.
- Town Hall
- >
- Keep
- >
- Castle
- Great Hall
- >
- Stronghold
- >
- Fortress
Options Property
Use the options property to create a breadcrumb navigation bar. The string value and index field of an option are used as unique identifiers. It is recommended to ensure their uniqueness.
- Home
- >
- Breadcrumb
Separator
Set the separator via the splitter property or the splitter slot of Breadcrumb.
- Home
- /
- Dashboard
- /
- Statistic
- Home
- →
- Dashboard
- →
- Statistic
API
BreadcrumbProps
| Attribute | Type | Optional | Default | Description | Version |
|---|---|---|---|---|---|
| options | (string | BreadcrumbOption)[] | True | | breadcrumb items. | 0.1.0 |
| splitter | string | True | '>' | separator between items. | 0.1.0 |
| renderLastText | boolean | True | true | whether to render the last item as plain text. | 0.1.0 |
BreadcrumbEvents
| Event | Parameter | Description | Version |
|---|---|---|---|
| select | index: string | number | symbol, event: MouseEvent | callback triggered when a breadcrumb item is selected. | 0.1.0 |
BreadcrumbSlots
| Slot | Parameter | Description | Version |
|---|---|---|---|
| default | | slot for breadcrumb items. | 0.1.0 |
| splitter | | slot for the separator. | 0.1.0 |
BreadcrumbItemProps
| Attribute | Type | Optional | Default | Description | Version |
|---|---|---|---|---|---|
| label | string | True | | Text label. | 0.1.0 |
| index | string | number | symbol | False | | Unique identifier. | 0.1.0 |
| disabled | boolean | True | false | Whether the item is disabled. | 0.1.0 |
| clickable | boolean | True | true | Whether the item is clickable. | 0.1.0 |
| href | string | True | | The href attribute for the <a> tag. When provided, the text label will be rendered as an <a> element. | 0.1.0 |
| route | string | object | True | | The to parameter for Vue Router's RouterLink. When provided, the text label will be rendered as a RouterLink <a> element. If using this property, ensure Vue Router is registered globally in your Vue App. | 0.1.0 |
| target | string | True | | The target attribute for the <a> tag. | 0.1.0 |
BreadcrumbItemSlots
| Slot | Parameter | Description | Version |
|---|---|---|---|
| default | | Slot for the text label. | 0.1.0 |
| icon | | Slot for the icon. | 0.1.0 |
BreadcrumbOption
export interface BreadcrumbOption extends NavigationOption {
disabled?: boolean
clickable?: boolean
href?: string
route?: string | object
target?: string
}
export interface NavigationOption {
index: string | number | symbol
label?: string
}2
3
4
5
6
7
8
9
10
11
12