From 061e8e39402e375723b3f4975630d0181cd83c24 Mon Sep 17 00:00:00 2001 From: msidolphin Date: Fri, 16 Aug 2019 09:28:33 +0800 Subject: [PATCH] fixed#6193 --- src/components/collapse/collapse.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/collapse/collapse.vue b/src/components/collapse/collapse.vue index 52016418..75be1d7e 100644 --- a/src/components/collapse/collapse.vue +++ b/src/components/collapse/collapse.vue @@ -42,12 +42,13 @@ methods: { setActive () { const activeKey = this.getActiveKey(); + this.$nextTick(() => { + this.$children.forEach((child, index) => { + const name = child.name || index.toString(); - this.$children.forEach((child, index) => { - const name = child.name || index.toString(); - - child.isActive = activeKey.indexOf(name) > -1; - child.index = index; + child.isActive = activeKey.indexOf(name) > -1; + child.index = index; + }); }); }, getActiveKey () {