소스 검색

Breadcrumb: code optimization (#10817)

qingming 7 년 전
부모
커밋
14eef644e9
1개의 변경된 파일3개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 4
      packages/breadcrumb/src/breadcrumb-item.vue

+ 3 - 4
packages/breadcrumb/src/breadcrumb-item.vue

@@ -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);
         });
       }
     }