feat: 修复热键监听导致的问题

pull/1/head
刘释隆 1 year ago
parent fd11c4f323
commit f6544852d0

@ -1,12 +1,12 @@
<script lang="ts" setup>
import { dateZhCN, zhCN } from "naive-ui";
import { computed, onMounted, nextTick } from "vue";
import { computed, onMounted, nextTick,inject } from "vue";
import { AppProvider } from "@/components/Application";
import { lighten } from "@/utils/index";
import mouseTrapBind from '@/hooks/event/mouseTrapBind'
const mousetrap = inject('mousetrap') as any
onMounted(()=>{
mouseTrapBind();
mouseTrapBind(mousetrap);
})
const getThemeOverrides = computed(() => {

@ -1,13 +1,10 @@
import { inject } from 'vue'
const mousetrap = inject('mousetrap') as any
const commonKeyDown = (keyCode: number) => {
document.dispatchEvent(new KeyboardEvent('keydown', { keyCode }));
}
const c = () => {
commonKeyDown(27)
}
const initBind = () => {
const initBind = (mousetrap) => {
mousetrap.bind('c', c)
}

Loading…
Cancel
Save