perf: hide context menu in tree view when press 'esc'
This commit is contained in:
parent
edaef2a78c
commit
124d221b9f
|
@ -567,7 +567,11 @@ defineExpose({
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div :style="{ backgroundColor }" class="flex-box-v browser-tree-wrapper" @contextmenu="(e) => e.preventDefault()">
|
||||
<div
|
||||
:style="{ backgroundColor }"
|
||||
class="flex-box-v browser-tree-wrapper"
|
||||
@contextmenu="(e) => e.preventDefault()"
|
||||
@keydown.esc="contextMenuParam.show = false">
|
||||
<n-spin v-if="props.loading" class="fill-height" />
|
||||
<n-empty v-else-if="!props.loading && isEmpty(data)" class="empty-content" />
|
||||
<n-tree
|
||||
|
|
|
@ -479,6 +479,7 @@ const onCancelOpen = () => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div class="connection-tree-wrapper" @keydown.esc="contextMenuParam.show = false">
|
||||
<n-empty
|
||||
v-if="isEmpty(connectionStore.connections)"
|
||||
:description="$t('interface.empty_server_list')"
|
||||
|
@ -538,8 +539,14 @@ const onCancelOpen = () => {
|
|||
trigger="manual"
|
||||
@clickoutside="contextMenuParam.show = false"
|
||||
@select="handleSelectContextMenu" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '@/styles/content';
|
||||
|
||||
.connection-tree-wrapper {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue