Fix tab switcher not working when some tabs hidden

This commit is contained in:
Tusooa Zhu 2022-04-09 23:49:22 -04:00
parent 87311cff09
commit 3b02566e16
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224

View file

@ -50,7 +50,7 @@ export default {
activeIndex () {
// In case of controlled component
if (this.activeTab) {
return this.slots().findIndex(slot => this.activeTab === slot.props.key)
return this.slots().findIndex(slot => slot && slot.props && this.activeTab === slot.props.key)
} else {
return this.active
}