mirror of https://github.com/ElemeFE/element
Breadcrumb: code optimization (#10817)
parent
b414efddfa
commit
14eef644e9
|
@ -29,14 +29,13 @@
|
||||||
mounted() {
|
mounted() {
|
||||||
this.separator = this.elBreadcrumb.separator;
|
this.separator = this.elBreadcrumb.separator;
|
||||||
this.separatorClass = this.elBreadcrumb.separatorClass;
|
this.separatorClass = this.elBreadcrumb.separatorClass;
|
||||||
let self = this;
|
|
||||||
if (this.to) {
|
if (this.to) {
|
||||||
let link = this.$refs.link;
|
let link = this.$refs.link;
|
||||||
|
let to = this.to;
|
||||||
link.setAttribute('role', 'link');
|
link.setAttribute('role', 'link');
|
||||||
link.addEventListener('click', _ => {
|
link.addEventListener('click', _ => {
|
||||||
let to = this.to;
|
this.replace ? this.$router.replace(to)
|
||||||
self.replace ? self.$router.replace(to)
|
: this.$router.push(to);
|
||||||
: self.$router.push(to);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue