commit
42e8dac708
1 changed files with 6 additions and 5 deletions
|
@ -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 || [];
|
||||||
|
|
Loading…
Add table
Reference in a new issue