fix(editor): 不允许选中跟节点

This commit is contained in:
roymondchen 2022-03-17 23:07:37 +08:00 committed by jia000
parent 2771d9fb2a
commit ca84c8f852

View File

@ -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);