This commit is contained in:
zyronon
2023-11-06 22:50:11 +08:00
parent f3fff00238
commit e1ebc5dcc2
7 changed files with 66 additions and 18 deletions

View File

@@ -27,7 +27,7 @@ const settingStore = useSettingStore()
<template>
<div class="options">
<Tooltip v-if="showEdit" :title="`编辑(快捷键:${settingStore.shortcutKeyMap[ShortcutKey.Edit]})`">
<Tooltip v-if="showEdit" :title="`编辑(快捷键:${settingStore.shortcutKeyMap[ShortcutKey.EditArticle]})`">
<IconWrapper>
<Icon icon="tabler:edit" class="menu"
@click="emit('edit')"/>

View File

@@ -185,7 +185,7 @@ function play() {
}
onMounted(() => {
emitter.on(ShortcutKey.Show, show)
emitter.on(ShortcutKey.ShowWord, show)
emitter.on(ShortcutKey.Skip, skip)
emitter.on(ShortcutKey.ToggleCollect, collect)
emitter.on(ShortcutKey.ToggleSimple, toggleWordSimpleWrapper)
@@ -193,7 +193,7 @@ onMounted(() => {
})
onUnmounted(() => {
emitter.off(ShortcutKey.Show, show)
emitter.off(ShortcutKey.ShowWord, show)
emitter.off(ShortcutKey.Skip, skip)
emitter.off(ShortcutKey.ToggleCollect, collect)
emitter.off(ShortcutKey.ToggleSimple, toggleWordSimpleWrapper)

View File

@@ -25,7 +25,7 @@ useWatchAllSound()
let editShortcutKey = $ref('')
const disabledDefaultKeyboardEvent = $computed(()=>{
const disabledDefaultKeyboardEvent = $computed(() => {
return editShortcutKey && tabIndex === 2
})
@@ -53,6 +53,11 @@ useEventListener('keydown', (e: KeyboardEvent) => {
}
})
function resetShortcutKeyMap() {
settingStore.shortcutKeyMap = cloneDeep(DefaultShortcutKeyMap)
ElMessage.success('恢复成功')
}
</script>
<template>
@@ -288,7 +293,7 @@ useEventListener('keydown', (e: KeyboardEvent) => {
<div class="row">
<label class="item-title"></label>
<div class="wrapper">
<BaseButton @click="settingStore.shortcutKeyMap = cloneDeep(DefaultShortcutKeyMap)">恢复默认</BaseButton>
<BaseButton @click="resetShortcutKeyMap">恢复默认</BaseButton>
</div>
</div>
</div>