QBreadcrumbs
Displays the location of the current page, shows all nested levels. Try a sandbox story
When to use
- When the system has more than two layers in a hierarchy.
- When you need to inform the user of where they are.
- When the user may need to navigate back to a higher level.
Example
Default view:
Using in template:
<q-breadcrumbs :route="route" />
1
Using in component instance:
setup() {
const route = [
{
path: 'path-a',
name: 'ROUTE_A',
meta: {
breadcrumb: 'First route'
}
},
{
path: 'path-b',
name: 'ROUTE_b',
meta: {
breadcrumb: 'Second route'
}
},
{
path: 'path-c',
name: 'ROUTE_c',
meta: {
breadcrumb: 'Third route'
}
},
];
return { route }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import type { QBreadcrumbsPropRoute } from '@qvant/qui-max';
setup() {
const route: QBreadcrumbsPropRoute = [
{
path: 'path-a',
name: 'ROUTE_A',
meta: {
breadcrumb: 'First route'
}
},
{
path: 'path-b',
name: 'ROUTE_b',
meta: {
breadcrumb: 'Second route'
}
},
{
path: 'path-c',
name: 'ROUTE_c',
meta: {
breadcrumb: 'Third route'
}
},
];
return { route };
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Props
route
- Type:
Array
- Default:
null
import type { QBreadcrumbsPropRoute } from '@qvant/qui-max';
1
route
MUST be an Array
of Object
s, each object MUST contain required fields:
path
- uses as route pathname
- route namemeta
- MUST contain:breadcrumb
- visible title
linkComponent
- Type:
String
- Default:
'RouterLink'
The name of the component for enabling user navigation in a router-enabled app, if you use Vue Router, you don't need change this prop, RouterLink
by default. With Nuxt change on NuxtLink
last
- Type:
String
Changes last crumb with custom string
<q-breadcrumbs :route="route" last="Custom string" />
1