소스 검색

Tabs: fix exception in scrollToActiveTab (#10187)

杨奕 7 년 전
부모
커밋
bfd7d0236c
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      packages/tabs/src/tab-nav.vue

+ 1 - 0
packages/tabs/src/tab-nav.vue

@@ -81,6 +81,7 @@
         if (!this.scrollable) return;
         const nav = this.$refs.nav;
         const activeTab = this.$el.querySelector('.is-active');
+        if (!activeTab) return;
         const navScroll = this.$refs.navScroll;
         const activeTabBounding = activeTab.getBoundingClientRect();
         const navScrollBounding = navScroll.getBoundingClientRect();