-
Notifications
You must be signed in to change notification settings - Fork 76
/
kbreadcrumbs.vue
82 lines (70 loc) · 2.75 KB
/
kbreadcrumbs.vue
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<template>
<DocsPageTemplate apiDocs>
<DocsPageSection title="Overview" anchor="#overview">
<div>
Breadcrumbs help understand the hierarchy among levels and a user's location in it. We often use breadcrumbs to aid navigation across channels, topic trees, and resources.
<DocsShow block>
<KBreadcrumbs
:items="[
{ text: 'Global Digital Library', link: { path: '#' } },
{ text: 'English', link: { path: '#' } },
{ text: 'Level 2 ', link: { path: '#' } },
]"
/>
</DocsShow>
</div>
<div>
Breadcrumbs take the full width of their container. When there is not enough space available, items that can't be displayed will automatically collapse into the drop-down and visible items might also get truncated:
<DocsShow
block
:style="{ maxWidth: '500px' }"
>
<KBreadcrumbs
:items="[
{ text: 'Global Digital Library', link: { path: '#' } },
{ text: 'English', link: { path: '#' } },
{ text: 'Level 2 ', link: { path: '#' } },
{ text: 'Kaka and Munni: A Folktale from Punjab', link: { path: '#' } }
]"
/>
</DocsShow>
</div>
<div>
When there is only one item, it won't be displayed by default. You can set <code>showSingleItem</code> to <code>true</code> to show it:
<DocsShow block>
<KBreadcrumbs
:items="[
{ text: 'Global Digital Library', link: { path: '#' } },
]"
showSingleItem
/>
</DocsShow>
</div>
<div>
Links to intermediary items can be disabled by omitting the <code>link</code> attribute, or making it falsey.
<DocsShow block>
<KBreadcrumbs
:items="[
{ text: 'Global Digital Library', link: { path: '#' } },
{ text: 'English' },
{ text: 'Reading ', link: { path: '#' } },
{ text: 'Level 2 ', link: { path: '#' } },
]"
/>
</DocsShow>
</div>
</DocsPageSection>
<DocsPageSection title="Placement" anchor="#placement">
<ul>
<li>Directly above the content to be navigated through</li>
</ul>
</DocsPageSection>
<DocsPageSection title="Guidelines" anchor="#guidelines">
<ul>
<li>It should include the current item</li>
<li>The current item can be repeated in a page header</li>
<li>Allow the single breadcrumb (<code>showSingleItem=true</code>) only when there isn't any other page header or label that shows what the current level is</li>
</ul>
</DocsPageSection>
</DocsPageTemplate>
</template>