feat: 容器组件支持传入 placeholder 和对应样式

This commit is contained in:
金禅 2020-09-01 19:11:09 +08:00
parent adf492779d
commit 0c4de43358
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) (!viewProps.style || Object.keys(viewProps.style).length === 0)
) { ) {
children = ( children = (
<div <div className="container-placeholder" style={viewProps.placeholderStyle}>
style={{
height:'44px',
lineHeight:'44px',
backgroundColor: '#f0f0f0',
borderColor: '#a7b1bd',
border: '1px dotted',
color: '#a7b1bd',
textAlign: 'center'
}}
>
{viewProps.placeholder || '拖拽组件或模板到这里'} {viewProps.placeholder || '拖拽组件或模板到这里'}
</div> </div>
); );

View File

@ -105,3 +105,13 @@ body.engine-document {
#app { #app {
height: 100vh; height: 100vh;
} }
.container-placeholder {
height: 44px;
line-height: 44px;
background-color: #f0f0f0;
border-color: #a7b1bd;
border: 1px dotted;
color: #a7b1bd;
text-align: center;
}