diff --git a/core/core-frontend/src/utils/DeShortcutKey.ts b/core/core-frontend/src/utils/DeShortcutKey.ts index a3465ded97..fae894ba77 100644 --- a/core/core-frontend/src/utils/DeShortcutKey.ts +++ b/core/core-frontend/src/utils/DeShortcutKey.ts @@ -11,7 +11,7 @@ const composeStore = composeStoreWithOut() const snapshotStore = snapshotStoreWithOut() const copyStore = copyStoreWithOut() const lockStore = lockStoreWithOut() -const { curComponent, isInEditor } = storeToRefs(dvMainStore) +const { curComponent, isInEditor, editMode } = storeToRefs(dvMainStore) const { areaData } = storeToRefs(composeStore) const ctrlKey = 17, @@ -101,7 +101,7 @@ let isShiftDown = false // 全局监听按键操作并执行相应命令 export function listenGlobalKeyDown() { window.onkeydown = e => { - if (!isInEditor || checkDialog()) return + if (!isInEditor.value || editMode.value === 'preview' || checkDialog()) return const { keyCode } = e if (positionMoveKey[keyCode] && curComponent.value) { positionMoveKey[keyCode](keyCode)