diff --git a/src/components/keyboard/KeyBoard.vue b/src/components/keyboard/KeyBoard.vue index 219c579..3eb41f6 100644 --- a/src/components/keyboard/KeyBoard.vue +++ b/src/components/keyboard/KeyBoard.vue @@ -7,19 +7,32 @@ import { useGlobalStore } from "../../store/global"; import { useDialog } from "naive-ui"; import { onBeforeRouteLeave } from "vue-router"; -// TODO 左键空白区域,关闭设置或active设为-1 // TODO 右键空白区域添加按键 // TODO 左键可拖动按钮(并显示到顶部),右键按钮进行修改、删除 // TODO 设置界面添加本地数据编辑器(类似utools) // TODO 添加开发者工具打开按钮 -const keyInfoShowFlag = ref(false); +const showKeyInfoFlag = ref(false); +const showSettingFlag = ref(false); const store = useGlobalStore(); const dialog = useDialog(); const activeButtonIndex = ref(-1); let edited = ref(false); +function handleClick(event: MouseEvent) { + if ( + event.button === 0 && + event.target === document.getElementById("keyboardElement") + ) { + if (showSettingFlag.value) { + showSettingFlag.value = false; + return; + } + activeButtonIndex.value = -1; + } +} + onBeforeRouteLeave(() => { if (edited.value) { dialog.warning({ @@ -41,9 +54,13 @@ onBeforeRouteLeave(() => {