fix: 优化选中页面根节点时, 直接点击组件面板插入位置

This commit is contained in:
力皓 2020-11-26 16:25:06 +08:00
parent c30e56a09a
commit c1ca2c6c3c

View File

@ -910,7 +910,8 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
if (dropElement) {
return { container: dropElement, ref };
}
return { container: this, ref };
// 假如最后找不到合适位置,返回 undefined 阻止继续插入节点
return undefined;
}
const canDropIn = this.componentMeta?.prototype?.options?.canDropIn;