fix(components): [tree] setCurrentKey() type error (#9709)

This commit is contained in:
zhiyuanzmj 2022-09-08 16:47:57 +08:00 committed by GitHub
parent f6d4574238
commit daefb75224
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -387,7 +387,7 @@ export default class TreeStore {
}
}
setCurrentNodeKey(key: TreeKey, shouldAutoExpandParent = true): void {
setCurrentNodeKey(key?: TreeKey, shouldAutoExpandParent = true): void {
if (key === null || key === undefined) {
this.currentNode && (this.currentNode.isCurrent = false)
this.currentNode = null

View File

@ -323,7 +323,7 @@ export default defineComponent({
)
}
const setCurrentKey = (key: TreeKey, shouldAutoExpandParent = true) => {
const setCurrentKey = (key?: TreeKey, shouldAutoExpandParent = true) => {
if (!props.nodeKey)
throw new Error('[Tree] nodeKey is required in setCurrentKey')