UNPKG

630 BPlain TextView Raw
1<template>
2 <div class="el-breadcrumb" aria-label="Breadcrumb" role="navigation">
3 <slot></slot>
4 </div>
5</template>
6<script>
7 export default {
8 name: 'ElBreadcrumb',
9
10 props: {
11 separator: {
12 type: String,
13 default: '/'
14 },
15 separatorClass: {
16 type: String,
17 default: ''
18 }
19 },
20
21 provide() {
22 return {
23 elBreadcrumb: this
24 };
25 },
26
27 mounted() {
28 const items = this.$el.querySelectorAll('.el-breadcrumb__item');
29 if (items.length) {
30 items[items.length - 1].setAttribute('aria-current', 'page');
31 }
32 }
33 };
34</script>