Tabs: fix error tab bar style

pull/14240/head
iamkun 2019-01-28 12:24:08 +08:00
parent af8267f948
commit ff1251f0b1
1 changed files with 1 additions and 2 deletions

View File

@ -15,7 +15,6 @@
computed: { computed: {
barStyle: { barStyle: {
get() { get() {
if (!this.$parent.$refs.tabs) return {};
let style = {}; let style = {};
let offset = 0; let offset = 0;
let tabSize = 0; let tabSize = 0;
@ -25,7 +24,7 @@
return str.toLowerCase().replace(/( |^)[a-z]/g, (L) => L.toUpperCase()); return str.toLowerCase().replace(/( |^)[a-z]/g, (L) => L.toUpperCase());
}; };
this.tabs.every((tab, index) => { this.tabs.every((tab, index) => {
let $el = arrayFind(this.$parent.$refs.tabs, t => t.id.replace('tab-', '') === tab.paneName); let $el = arrayFind(this.$parent.$refs.tabs || [], t => t.id.replace('tab-', '') === tab.paneName);
if (!$el) { return false; } if (!$el) { return false; }
if (!tab.active) { if (!tab.active) {