diff --git a/docs/.vitepress/vitepress/components/vp-app.vue b/docs/.vitepress/vitepress/components/vp-app.vue index 6252d1b0a7..f2e6235b4a 100644 --- a/docs/.vitepress/vitepress/components/vp-app.vue +++ b/docs/.vitepress/vitepress/components/vp-app.vue @@ -4,6 +4,7 @@ import { onMounted } from 'vue' import nprogress from 'nprogress' // import dayjs from 'dayjs' import { isClient, useEventListener, useToggle } from '@vueuse/core' +import { EVENT_CODE } from 'element-plus' import { useSidebar } from '../composables/sidebar' import { useToggleWidgets } from '../composables/toggle-widgets' // import { useLang } from '../composables/lang' @@ -36,7 +37,7 @@ useToggleWidgets(isSidebarOpen, () => { useEventListener('keydown', (e) => { if (!isClient) return - if (e.key === 'Escape' && isSidebarOpen.value) { + if (e.code === EVENT_CODE.esc && isSidebarOpen.value) { toggleSidebar(false) document.querySelector('.sidebar-button')?.focus() } diff --git a/docs/.vitepress/vitepress/components/vp-demo.vue b/docs/.vitepress/vitepress/components/vp-demo.vue index 3dc3a2157a..fe43126958 100644 --- a/docs/.vitepress/vitepress/components/vp-demo.vue +++ b/docs/.vitepress/vitepress/components/vp-demo.vue @@ -1,6 +1,7 @@