新增占位容器

This commit is contained in:
zude.hzd 2020-07-20 15:00:43 +08:00
parent c4f9505b1b
commit e65a038795

View File

@ -108,6 +108,17 @@ class Renderer extends Component<{ renderer: SimulatorRenderer }> {
const leaf = host.document.getNode(__id);
viewProps._leaf = leaf;
viewProps._componentName = leaf?.componentName;
// 如果是容器 && 无children && 高宽为空 增加一个占位容器,方便拖动
if (leaf.isContainer() && children == null && !viewProps.style){
Object.assign(viewProps, {
style:{
height:'100px',
backgroundColor:'#f0f0f0',
borderColor:'#666666',
border: '1px dotted'
}
})
}
if (viewProps._componentName === 'Menu') {
Object.assign(viewProps, {