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
2771d9fb2a
commit
ca84c8f852
@ -184,6 +184,10 @@ class Editor extends BaseService {
|
||||
const { node, parent, page } = this.getNodeInfo(id);
|
||||
if (!node) throw new Error('获取不到组件信息');
|
||||
|
||||
if (node.id === this.state.root?.id) {
|
||||
throw new Error('不能选根节点');
|
||||
}
|
||||
|
||||
this.set('node', node);
|
||||
this.set('page', page || null);
|
||||
this.set('parent', parent || null);
|
||||
|
Loading…
x
Reference in New Issue
Block a user