diff --git a/src/components/search/search.vue b/src/components/search/search.vue index eb20973b..746bbaa2 100644 --- a/src/components/search/search.vue +++ b/src/components/search/search.vue @@ -31,7 +31,7 @@ _.tag) @@ -26,12 +26,12 @@ export default Vue.component('tab-switcher', { } }, isActiveTab (index) { - const customActiveIndex = this.$slots.default.findIndex(slot => { - const dataFilter = slot.data && slot.data.attrs && slot.data.attrs['data-filter'] - return this.customActive && this.customActive === dataFilter - }) - - return customActiveIndex > -1 ? customActiveIndex === index : index === this.active + // In case of controlled component + if (this.activeTab) { + return this.$slots.default.findIndex(slot => this.activeTab === slot.key) === index + } else { + return this.active === index + } } }, render (h) { @@ -47,7 +47,7 @@ export default Vue.component('tab-switcher', { } if (slot.data.attrs.image) { return ( -
+