fix: leaf should be type of ShellNode other than InnerNode

This commit is contained in:
LeoYuan 袁力皓 2022-09-15 14:28:38 +08:00 committed by 刘菊萍(絮黎)
parent 2dbd66cb28
commit 5bb8cf5d12
2 changed files with 2 additions and 3 deletions

View File

@ -40,8 +40,7 @@ export default class LeftFloatPane extends Component<{ area: Area<any, Panel> }>
return true;
}
// 点击了 iframe 内容,算失焦
if (document.querySelector('.lc-simulator-content-frame')
.contentWindow.document.documentElement.contains(target)) {
if ((document.querySelector('.lc-simulator-content-frame') as HTMLIFrameElement)?.contentWindow?.document.documentElement.contains(target)) {
return false;
}
// 点击设置区

View File

@ -195,7 +195,7 @@ class Renderer extends Component<{
viewProps.componentId = __id;
const leaf = documentInstance.getNode(__id) as Node;
if (isFromVC(leaf?.componentMeta)) {
viewProps._leaf = leaf;
viewProps._leaf = leaf.internalToShellNode();
}
viewProps._componentName = leaf?.componentName;
// 如果是容器 && 无children && 高宽为空 增加一个占位容器,方便拖动