Commit 16311d1e authored by iamkun's avatar iamkun Committed by hetech

Tabs: get the correct tab through tab name (#13705)

parent f7241f62
......@@ -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',
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment