fix: root key may not expand after switch to check mode in key tree
This commit is contained in:
parent
5e970982a2
commit
84b73bd5e7
|
@ -171,12 +171,13 @@ const renderContextLabel = (option) => {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {string} key
|
* @param {string} key
|
||||||
|
* @param {boolean} [toggle]
|
||||||
*/
|
*/
|
||||||
const expandKey = (key) => {
|
const expandKey = (key, toggle) => {
|
||||||
const idx = indexOf(expandedKeys.value, key)
|
const idx = indexOf(expandedKeys.value, key)
|
||||||
if (idx === -1) {
|
if (idx === -1) {
|
||||||
expandedKeys.value.push(key)
|
expandedKeys.value.push(key)
|
||||||
} else {
|
} else if (toggle !== false) {
|
||||||
expandedKeys.value.splice(idx, 1)
|
expandedKeys.value.splice(idx, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -562,7 +563,7 @@ watchEffect(
|
||||||
if (!props.checkMode) {
|
if (!props.checkMode) {
|
||||||
tabStore.setCheckedKeys(props.server)
|
tabStore.setCheckedKeys(props.server)
|
||||||
} else {
|
} else {
|
||||||
expandKey(`${ConnectionType.RedisDB}`)
|
expandKey(`${ConnectionType.RedisDB}`, false)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ flush: 'post' },
|
{ flush: 'post' },
|
||||||
|
|
Loading…
Reference in New Issue