组织结构树选中组件默认选中第一个节点

This commit is contained in:
qinjie 2021-09-01 14:44:31 +08:00
parent 2ade51f1c2
commit e06874281e
1 changed files with 7 additions and 1 deletions

View File

@ -108,8 +108,14 @@ export default {
this.selectKey = this.defaultOrganizationId;
this.$emit('getSelectTreeKey', this.selectKey);
}
} else {
//
let firstNode = this.treeData[0];
this.defaultSelectedKeys.push(firstNode.key);
this.selectTitle = firstNode.title;
this.selectKey = firstNode.key;
this.$emit('getSelectTreeKey', this.selectKey);
}
console.log(this.defaultSelectedKeys)
},
methods: {
//