组织结构树选中组件默认选中第一个节点
This commit is contained in:
parent
2ade51f1c2
commit
e06874281e
|
@ -108,8 +108,14 @@ export default {
|
||||||
this.selectKey = this.defaultOrganizationId;
|
this.selectKey = this.defaultOrganizationId;
|
||||||
this.$emit('getSelectTreeKey', this.selectKey);
|
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: {
|
methods: {
|
||||||
// 点击组织机构数节点时调用
|
// 点击组织机构数节点时调用
|
||||||
|
|
Loading…
Reference in New Issue