Merge pull request #6194 from msidolphin/bug#6193

fixed #6193
This commit is contained in:
debugIsFalse 2019-09-24 10:07:08 +08:00 committed by GitHub
commit 42e8dac708
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,13 +42,14 @@
methods: { methods: {
setActive () { setActive () {
const activeKey = this.getActiveKey(); const activeKey = this.getActiveKey();
this.$nextTick(() => {
this.$children.forEach((child, index) => { this.$children.forEach((child, index) => {
const name = child.name || index.toString(); const name = child.name || index.toString();
child.isActive = activeKey.indexOf(name) > -1; child.isActive = activeKey.indexOf(name) > -1;
child.index = index; child.index = index;
}); });
});
}, },
getActiveKey () { getActiveKey () {
let activeKey = this.currentValue || []; let activeKey = this.currentValue || [];