diff --git a/src/components/AppSidebar/AppSidebar.vue b/src/components/AppSidebar/AppSidebar.vue index c6435d4817..8e0f49ebd5 100644 --- a/src/components/AppSidebar/AppSidebar.vue +++ b/src/components/AppSidebar/AppSidebar.vue @@ -166,27 +166,22 @@ export default { }, mounted() { // Init tabs from $children - const tabs = this.$children.filter(comp => comp.$options.name === 'AppSidebarTab') - if (tabs.length === 0 || tabs.length === this.$children.length) { - this.tabs = tabs.reduce((tabs, tab) => { - if (!tab.name || typeof tab.name !== 'string') { - Vue.util.warn(`This tab is missing a valid name: ${tab.name}`, tab) - return tabs - } - if (!IsValidString(tab.id)) { - Vue.util.warn(`This tab is missing a valid id: ${tab.id}`, tab) - return tabs - } - if (!IsValidString(tab.icon)) { - Vue.util.warn(`This tab is missing a valid icon: ${tab.icon}`, tab) - return tabs - } - tabs.push(tab) + this.tabs = this.$children.reduce((tabs, tab) => { + if (!tab.name || typeof tab.name !== 'string') { + Vue.util.warn(`This tab is missing a valid name: ${tab.name}`, tab) return tabs - }, []) - } else { - Vue.util.warn('You must use either AppSideTab\'s or custom elements.') - } + } + if (!IsValidString(tab.id)) { + Vue.util.warn(`This tab is missing a valid id: ${tab.id}`, tab) + return tabs + } + if (!IsValidString(tab.icon)) { + Vue.util.warn(`This tab is missing a valid icon: ${tab.icon}`, tab) + return tabs + } + tabs.push(tab) + return tabs + }, []) // init active tab if exists if (this.tabs.length > 0) {