web: 修复快捷键设置bug和esc键逻辑; 修复超大章节列表造成的卡顿
bug: 第一点击目录时没有跳转到合适位置
This commit is contained in:
1 parent
7bd45c46fb
commit
23018b702d
5 files changed
+64
-84
No files matched your search
@@ -221,21 +221,31 @@ const recordKeyDowning = ref(false);
|
||||
const recordKeyDownIndex = ref(-1);
|
||||
|
||||
const stopRecordKeyDown = () => {
|
||||
if (!recordKeyDowning.value) {
|
||||
hotkeysDialogVisible.value = false;
|
||||
}
|
||||
recordKeyDowning.value = false;
|
||||
};
|
||||
|
||||
watch(hotkeysDialogVisible, (visibale) => {
|
||||
if (!visibale) return hotkeys.unbind("*");
|
||||
hotkeys.unbind();
|
||||
/**监听按键 */
|
||||
hotkeys("*", (event) => {
|
||||
event.preventDefault();
|
||||
if (recordKeyDowning.value && recordKeyDownIndex.value > -1)
|
||||
buttons.value[recordKeyDownIndex.value].hotKeys =
|
||||
// @ts-ignore
|
||||
hotkeys.getPressedKeyString();
|
||||
});
|
||||
});
|
||||
watch(
|
||||
hotkeysDialogVisible,
|
||||
(visibale) => {
|
||||
if (!visibale) return hotkeys.unbind("*");
|
||||
hotkeys.unbind();
|
||||
/**监听按键 */
|
||||
hotkeys("*", (event) => {
|
||||
event.preventDefault();
|
||||
let pressedKeys = hotkeys.getPressedKeyString();
|
||||
if (pressedKeys.length == 1 && pressedKeys[0] == "esc") {
|
||||
//单独按下esc 不录入
|
||||
return;
|
||||
}
|
||||
if (recordKeyDowning.value && recordKeyDownIndex.value > -1)
|
||||
buttons.value[recordKeyDownIndex.value].hotKeys = pressedKeys;
|
||||
});
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
const recordKeyDown = (index) => {
|
||||
recordKeyDowning.value = true;
|
||||
|
||||
Reference in new issue
Block a user