mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-11-30 11:17:38 +08:00
Breadcrumb: code optimization (#10817)
This commit is contained in:
parent
b414efddfa
commit
14eef644e9
@ -29,14 +29,13 @@
|
||||
mounted() {
|
||||
this.separator = this.elBreadcrumb.separator;
|
||||
this.separatorClass = this.elBreadcrumb.separatorClass;
|
||||
let self = this;
|
||||
if (this.to) {
|
||||
let link = this.$refs.link;
|
||||
let to = this.to;
|
||||
link.setAttribute('role', 'link');
|
||||
link.addEventListener('click', _ => {
|
||||
let to = this.to;
|
||||
self.replace ? self.$router.replace(to)
|
||||
: self.$router.push(to);
|
||||
this.replace ? this.$router.replace(to)
|
||||
: this.$router.push(to);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user