mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 09:41:57 +00:00
Merge branch feat/mutiDevice into release/1.0.41
Title: 增加deviceStyle 属性 Link: https://code.aone.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/codereview/5122605
This commit is contained in:
commit
906a812601
@ -54,6 +54,7 @@ class Canvas extends Component<{ host: BuiltinSimulatorHost }> {
|
||||
render() {
|
||||
const sim = this.props.host;
|
||||
let className = 'lc-simulator-canvas';
|
||||
const { canvas = {}, viewport = {} } = sim.deviceStyle || {};
|
||||
if (sim.deviceClassName) {
|
||||
className += ` ${sim.deviceClassName}`;
|
||||
} else if (sim.device) {
|
||||
@ -61,8 +62,8 @@ class Canvas extends Component<{ host: BuiltinSimulatorHost }> {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={className}>
|
||||
<div ref={(elmt) => sim.mountViewport(elmt)} className="lc-simulator-canvas-viewport">
|
||||
<div className={className} style={canvas}>
|
||||
<div ref={(elmt) => sim.mountViewport(elmt)} className="lc-simulator-canvas-viewport" style={viewport}>
|
||||
<BemTools host={sim} />
|
||||
<Content host={sim} />
|
||||
</div>
|
||||
|
||||
@ -48,6 +48,11 @@ export interface LibraryItem {
|
||||
urls?: Asset;
|
||||
}
|
||||
|
||||
export interface DeviceStyleProps {
|
||||
canvas?: object;
|
||||
viewport?: object;
|
||||
}
|
||||
|
||||
export interface BuiltinSimulatorProps {
|
||||
// 从 documentModel 上获取
|
||||
// suspended?: boolean;
|
||||
@ -178,6 +183,10 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
return this.designer.componentsMap;
|
||||
}
|
||||
|
||||
@computed get deviceStyle(): DeviceStyleProps | undefined {
|
||||
return this.get('deviceStyle');
|
||||
}
|
||||
|
||||
@obx.ref _props: BuiltinSimulatorProps = {};
|
||||
|
||||
/**
|
||||
|
||||
@ -4,9 +4,6 @@ body, html {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
html.engine-design-mode {
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
|
||||
html.engine-cursor-move, html.engine-cursor-move * {
|
||||
cursor: grabbing !important;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user