mirror of
https://github.com/tiny-craft/tiny-rdm.git
synced 2025-04-23 23:08:06 +08:00
perf: add expand/collapse group folder with double click
This commit is contained in:
parent
1702246609
commit
22f71e4676
@ -216,11 +216,23 @@ const removeGroup = async (name) => {
|
||||
})
|
||||
}
|
||||
|
||||
const expandKey = (key) => {
|
||||
const idx = indexOf(expandedKeys.value, key)
|
||||
if (idx === -1) {
|
||||
expandedKeys.value.push(key)
|
||||
} else {
|
||||
expandedKeys.value.splice(idx, 1)
|
||||
}
|
||||
}
|
||||
|
||||
const nodeProps = ({ option }) => {
|
||||
return {
|
||||
onDblclick: async () => {
|
||||
if (option.type === ConnectionType.Server) {
|
||||
openConnection(option.name).then(() => {})
|
||||
} else if (option.type === ConnectionType.Group) {
|
||||
// toggle expand
|
||||
nextTick().then(() => expandKey(option.key))
|
||||
}
|
||||
},
|
||||
onContextmenu(e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user