Commit c8477c81 authored by Pan's avatar Pan Committed by 杨奕

Breadcrumb: use provide/inject instead of this.this.$parent

parent 38e320b8
...@@ -20,9 +20,12 @@ ...@@ -20,9 +20,12 @@
separatorClass: '' separatorClass: ''
}; };
}, },
inject: ['elBreadcrumb'],
mounted() { mounted() {
this.separator = this.$parent.separator; this.separator = this.elBreadcrumb.separator;
this.separatorClass = this.$parent.separatorClass; this.separatorClass = this.elBreadcrumb.separatorClass;
let self = this; let self = this;
if (this.to) { if (this.to) {
let link = this.$refs.link; let link = this.$refs.link;
......
...@@ -17,6 +17,13 @@ ...@@ -17,6 +17,13 @@
default: '' default: ''
} }
}, },
provide() {
return {
elBreadcrumb: this
};
},
mounted() { mounted() {
const items = this.$el.querySelectorAll('.el-breadcrumb__item'); const items = this.$el.querySelectorAll('.el-breadcrumb__item');
items[items.length - 1].setAttribute('aria-current', 'page'); items[items.length - 1].setAttribute('aria-current', 'page');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment