mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
fix(editor): 在组件树中多选时不能选中页面
This commit is contained in:
parent
57be30cf6b
commit
c456798751
@ -2,6 +2,7 @@ import { computed, type ComputedRef, nextTick, type Ref, ref } from 'vue';
|
|||||||
import { throttle } from 'lodash-es';
|
import { throttle } from 'lodash-es';
|
||||||
|
|
||||||
import { Id, MNode } from '@tmagic/schema';
|
import { Id, MNode } from '@tmagic/schema';
|
||||||
|
import { isPage, isPageFragment } from '@tmagic/utils';
|
||||||
|
|
||||||
import { LayerNodeStatus, Services, TreeNodeData, UI_SELECT_MODE_EVENT_NAME } from '@editor/type';
|
import { LayerNodeStatus, Services, TreeNodeData, UI_SELECT_MODE_EVENT_NAME } from '@editor/type';
|
||||||
import { updateStatus } from '@editor/utils/tree';
|
import { updateStatus } from '@editor/utils/tree';
|
||||||
@ -31,6 +32,10 @@ export const useClick = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
const multiSelect = async (data: MNode) => {
|
const multiSelect = async (data: MNode) => {
|
||||||
|
if (isPage(data) || isPageFragment(data)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const nodes = services?.editorService.get('nodes') || [];
|
const nodes = services?.editorService.get('nodes') || [];
|
||||||
|
|
||||||
const newNodes: Id[] = [];
|
const newNodes: Id[] = [];
|
||||||
@ -41,6 +46,10 @@ export const useClick = (
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isPage(node) || isPageFragment(node)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
newNodes.push(node.id);
|
newNodes.push(node.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user