diff --git a/src/views/ManagePage.vue b/src/views/ManagePage.vue index 7a5fcc0..add7e89 100644 --- a/src/views/ManagePage.vue +++ b/src/views/ManagePage.vue @@ -99,7 +99,7 @@ -
+

{{ superCategoryForm.id ? '编辑分类' : '添加分类' }}

@@ -122,7 +122,7 @@
-
+

{{ categoryForm.id ? '编辑书签分组' : '添加书签分组' }}

@@ -153,7 +153,7 @@
-
+

{{ isCopyMode ? '复制网址' : (toolForm.id ? '编辑网址' : '添加网址') }}

@@ -229,7 +229,7 @@
-
+
⚠️
{{ confirmMessage }}
@@ -377,10 +377,13 @@ export default { }) // 监听窗口大小变化 window.addEventListener('resize', this.adjustContainerPadding) + // 监听ESC键关闭弹框 + window.addEventListener('keydown', this.handleEscKey) }, beforeDestroy() { window.removeEventListener('resize', this.adjustContainerPadding) + window.removeEventListener('keydown', this.handleEscKey) }, updated() { @@ -391,6 +394,21 @@ export default { }, methods: { + // ESC键关闭弹框 + handleEscKey(event) { + if (event.key === 'Escape' || event.keyCode === 27) { + if (this.showSuperCategoryDialog) { + this.closeSuperCategoryDialog() + } else if (this.showCategoryDialog) { + this.closeCategoryDialog() + } else if (this.showToolDialog) { + this.closeToolDialog() + } else if (this.showConfirmDialog) { + this.cancelConfirm() + } + } + }, + // 动态调整容器padding-top adjustContainerPadding() { setTimeout(() => {