Chapters of toolbar are switchable

This commit is contained in:
zyronon
2023-11-12 23:59:05 +08:00
parent 60e3975b3e
commit 4bf40d7780
13 changed files with 217 additions and 127 deletions

View File

@@ -53,10 +53,9 @@ export function useStartKeyboardEventListener() {
const settingStore = useSettingStore()
useEventListener('keydown', (e: KeyboardEvent) => {
e.preventDefault()
// console.log('e',e.keyCode,e.code)
if (!runtimeStore.disableEventListener) {
e.preventDefault()
let shortcutKey = getShortcutKey(e)
// console.log('shortcutKey', shortcutKey)
@@ -117,7 +116,7 @@ export function useOnKeyboardEventListener(onKeyDown: (e: KeyboardEvent) => void
export function useDisableEventListener(watchVal?: any) {
const runtimeStore = useRuntimeStore()
watch(() => watchVal, n => {
watch(watchVal, n => {
if (n) {
runtimeStore.disableEventListener = true
} else {
@@ -125,12 +124,12 @@ export function useDisableEventListener(watchVal?: any) {
}
})
onMounted(() => {
if (!watchVal) {
if (watchVal === undefined) {
runtimeStore.disableEventListener = true
}
})
onUnmounted(() => {
if (!watchVal) {
if (watchVal === undefined) {
runtimeStore.disableEventListener = false
}
})