Skip to content

Commit

Permalink
Tabs: get the correct tab through tab name (ElemeFE#13705)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkun authored and ziyoung committed Dec 10, 2018
1 parent f7241f6 commit 16311d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/tabs/src/tab-bar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div class="el-tabs__active-bar" :class="`is-${ rootTabs.tabPosition }`" :style="barStyle"></div>
</template>
<script>
import { arrayFind } from 'element-ui/src/utils/util';
export default {
name: 'TabBar',
Expand All @@ -25,7 +26,7 @@
return str.toLowerCase().replace(/( |^)[a-z]/g, (L) => L.toUpperCase());
};
this.tabs.every((tab, index) => {
let $el = this.$parent.$refs.tabs[index];
let $el = arrayFind(this.$parent.$refs.tabs, t => t.id.replace('tab-', '') === tab.name);
if (!$el) { return false; }
if (!tab.active) {
Expand Down

0 comments on commit 16311d1

Please sign in to comment.