mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-05 20:58:22 +08:00
fix(components): [tree] setCurrentKey() type error (#9709)
This commit is contained in:
parent
f6d4574238
commit
daefb75224
@ -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
|
||||
|
@ -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')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user