mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-22 06:49:57 +08:00
fix(editor): 删除的快捷键操作,不要对页面生效
This commit is contained in:
parent
9526c44d16
commit
9efe4f04fc
@ -24,6 +24,7 @@ import KeyController from 'keycon';
|
||||
import type { MNode, MPage } from '@tmagic/schema';
|
||||
import type { MoveableOptions } from '@tmagic/stage';
|
||||
import StageCore from '@tmagic/stage';
|
||||
import { isPage } from '@tmagic/utils';
|
||||
|
||||
import type { Services } from '@editor/type';
|
||||
|
||||
@ -77,7 +78,8 @@ export default defineComponent({
|
||||
|
||||
keycon
|
||||
.keyup('delete', () => {
|
||||
node.value && services?.editorService.remove(node.value);
|
||||
if (!node.value || isPage(node.value)) return;
|
||||
services?.editorService.remove(node.value);
|
||||
})
|
||||
.keyup(['ctrl', 'c'], () => {
|
||||
node.value && services?.editorService.copy(node.value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user