12345678910111213141516171819202122232425262728293031323334 |
- <template>
- <div class="el-breadcrumb" aria-label="Breadcrumb" role="navigation">
- <slot></slot>
- </div>
- </template>
- <script>
- export default {
- name: 'ElBreadcrumb',
- props: {
- separator: {
- type: String,
- default: '/'
- },
- separatorClass: {
- type: String,
- default: ''
- }
- },
- provide() {
- return {
- elBreadcrumb: this
- };
- },
- mounted() {
- const items = this.$el.querySelectorAll('.el-breadcrumb__item');
- if (items.length) {
- items[items.length - 1].setAttribute('aria-current', 'page');
- }
- }
- };
- </script>
|