From dbff8f9e798063597f4815e9bda918c82c59e9a9 Mon Sep 17 00:00:00 2001 From: Lykin <137850705+tiny-craft@users.noreply.github.com> Date: Thu, 11 Jan 2024 23:55:03 +0800 Subject: [PATCH] perf: select key when right click in browser tree --- frontend/src/components/sidebar/BrowserTree.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/sidebar/BrowserTree.vue b/frontend/src/components/sidebar/BrowserTree.vue index 3f97fce..032bf26 100644 --- a/frontend/src/components/sidebar/BrowserTree.vue +++ b/frontend/src/components/sidebar/BrowserTree.vue @@ -153,7 +153,7 @@ const menuOptions = { ], } -const handleSelectContextMenu = (key) => { +const handleSelectContextMenu = (action) => { contextMenuParam.show = false const selectedKey = get(selectedKeys.value, 0) if (selectedKey == null) { @@ -163,7 +163,7 @@ const handleSelectContextMenu = (key) => { const { db = 0, key: nodeKey, redisKey: rk = '', redisKeyCode: rkc, label } = node || {} const redisKey = rkc || rk const redisKeyName = !!rkc ? label : redisKey - switch (key) { + switch (action) { case 'key_newkey': dialogStore.openNewKeyDialog(redisKey, props.server, db) break @@ -226,7 +226,7 @@ const handleSelectContextMenu = (key) => { break case 'more_action': default: - console.warn('TODO: handle context menu:' + key) + console.warn('TODO: handle context menu:' + action) } } @@ -501,7 +501,7 @@ const nodeProps = ({ option }) => { contextMenuParam.x = e.clientX contextMenuParam.y = e.clientY contextMenuParam.show = true - // onUpdateSelectedKeys([option.key], [option]) + onUpdateSelectedKeys([option.key], [option]) }) }, // onMouseover() {