From 8b41022044707b33f22aeec4d9dbd04db4f381f6 Mon Sep 17 00:00:00 2001 From: Aresn Date: Fri, 18 May 2018 10:47:04 +0800 Subject: [PATCH] handleTabKeyboardSelect add params init --- src/components/tabs/tabs.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/tabs/tabs.vue b/src/components/tabs/tabs.vue index c571493..d7426dc 100644 --- a/src/components/tabs/tabs.vue +++ b/src/components/tabs/tabs.vue @@ -236,7 +236,8 @@ const nextTab = getNextTab(this.navList, this.focusedKey, direction); this.focusedKey = nextTab.name; }, - handleTabKeyboardSelect(){ + handleTabKeyboardSelect(init = false){ + if (init) return; const focused = this.focusedKey || 0; const index = this.navList.findIndex(({name}) => name === focused); this.handleChange(index); @@ -416,7 +417,7 @@ this.mutationObserver.observe(hiddenParentNode, { attributes: true, childList: true, characterData: true, attributeFilter: ['style'] }); } - this.handleTabKeyboardSelect(); + this.handleTabKeyboardSelect(true); }, beforeDestroy() { this.observer.removeListener(this.$refs.navWrap, this.handleResize); -- libgit2 0.21.4