diff --git a/src/components/accordion/Accordion.vue b/src/components/accordion/Accordion.vue index 69ffb95053..5bc8bb2d02 100644 --- a/src/components/accordion/Accordion.vue +++ b/src/components/accordion/Accordion.vue @@ -44,11 +44,11 @@ export default { }, data() { return { - tabs: [] + d_children: [] }; }, mounted() { - this.tabs = this.$children.filter(child => child.$options._componentTag.indexOf('AccordionTab')===0); + this.d_children = this.$children; }, methods: { onTabClick(event, tab) { @@ -76,6 +76,11 @@ export default { return this.props.multiple ? (this.d_activeTabIndex && this.d_activeTabIndex.indexOf(index) >= 0) : this.d_activeTabIndex === index; } }, + computed: { + tabs() { + return this.d_children.filter(child => child.$vnode.tag.indexOf('accordiontab') !== -1); + } + }, components: { 'AccordionTabSlot': AccordionTabSlot } diff --git a/src/components/accordiontab/AccordionTab.vue b/src/components/accordiontab/AccordionTab.vue index 9edbb12c1f..40943d34c3 100644 --- a/src/components/accordiontab/AccordionTab.vue +++ b/src/components/accordiontab/AccordionTab.vue @@ -1,5 +1,6 @@