Merge branch 'feat/container-placeholder' into 'release/1.0.0'

feat: 🎸 为容器的占位元素增加一个特定的 class 方便在设计器里定制样式

React 环境下默认对于空容器会增加一个这样的 div 元素方便拖放其内容:
![image](http://git.cn-hangzhou.oss-cdn.aliyun-inc.com/uploads/ali-lowcode/ali-lowcode-engine/743017dbc83ce51fc28fcd55a696d0a2/image.png)
但是注意,其中红线标出的 class 其实之前没有,结果会导致很难定制这个占位元素的样式 -- 比如在卡片组件中,如下图(1)所示标题栏右侧占位的高度就会很高,比较丑;更严重的是如下图(2)所示的,副标题插槽会被换行到看不见的位置:

![image](http://git.cn-hangzhou.oss-cdn.aliyun-inc.com/uploads/ali-lowcode/ali-lowcode-engine/277ccca69f1678fed49a550fcb1b9d41/image.png)

所以,建议增加这样一个特定 class,这样以后可以在设计器里来调整这个占位元素的样式。


See merge request !955505
This commit is contained in:
荣彬 2020-09-03 09:43:20 +08:00
commit ac543a1c3b
2 changed files with 11 additions and 11 deletions

View File

@ -117,17 +117,7 @@ class Renderer extends Component<{ renderer: SimulatorRenderer }> {
(!viewProps.style || Object.keys(viewProps.style).length === 0)
) {
children = (
<div
style={{
height:'44px',
lineHeight:'44px',
backgroundColor: '#f0f0f0',
borderColor: '#a7b1bd',
border: '1px dotted',
color: '#a7b1bd',
textAlign: 'center'
}}
>
<div className="lc-container-placeholder">
{viewProps.placeholder || '拖拽组件或模板到这里'}
</div>
);

View File

@ -53,6 +53,16 @@ html.engine-cursor-ew-resize, html.engine-cursor-ew-resize * {
}
}
.lc-container-placeholder {
height: 44px;
line-height: 44px;
background-color: #f0f0f0;
border-color: #a7b1bd;
border: 1px dotted;
color: #a7b1bd;
text-align: center;
}
.engine-empty {
background: #f2f3f5;
color: #a7b1bd;