mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
feat: extend deviceClassName
This commit is contained in:
parent
bccce8c8a9
commit
0e96074c85
@ -29,23 +29,7 @@
|
||||
box-shadow: 0 2px 10px 0 rgba(31,56,88,.15);
|
||||
}
|
||||
|
||||
// &-device-mobile {
|
||||
// left: 50%;
|
||||
// width: 378px;
|
||||
// transform: translateX(-50%);
|
||||
// background: url(https://img.alicdn.com/tfs/TB1b4DHilFR4u4jSZFPXXanzFXa-750-1574.png) no-repeat top;
|
||||
// background-size: 378px 812px;
|
||||
// top: 8px;
|
||||
// .@{scope}-canvas-viewport {
|
||||
// width: auto;
|
||||
// top: 90px;
|
||||
// left: 0px;
|
||||
// right: 0px;
|
||||
// max-height: 688px;
|
||||
// }
|
||||
// }
|
||||
|
||||
&-device-miniapp { // 增加默认的小程序的壳
|
||||
&-device-iphonex { // 增加默认的小程序的壳
|
||||
left: 50%;
|
||||
width: 378px;
|
||||
transform: translateX(-50%);
|
||||
|
||||
@ -14,6 +14,7 @@ interface DesignerPluginState {
|
||||
renderEnv?: string;
|
||||
device?: string;
|
||||
designMode?: string;
|
||||
deviceClassName?: string;
|
||||
}
|
||||
|
||||
export default class DesignerPlugin extends PureComponent<PluginProps, DesignerPluginState> {
|
||||
@ -26,6 +27,7 @@ export default class DesignerPlugin extends PureComponent<PluginProps, DesignerP
|
||||
renderEnv: 'default',
|
||||
device: 'default',
|
||||
designMode: 'live',
|
||||
deviceClassName: '',
|
||||
};
|
||||
|
||||
private _mounted = true;
|
||||
@ -42,6 +44,7 @@ export default class DesignerPlugin extends PureComponent<PluginProps, DesignerP
|
||||
const renderEnv = await editor.get('renderEnv');
|
||||
const device = await editor.get('device');
|
||||
const designMode = await editor.get('designMode');
|
||||
const deviceClassName = await editor.get('deviceClassName');
|
||||
if (!this._mounted) {
|
||||
return;
|
||||
}
|
||||
@ -53,6 +56,7 @@ export default class DesignerPlugin extends PureComponent<PluginProps, DesignerP
|
||||
renderEnv,
|
||||
device,
|
||||
designMode,
|
||||
deviceClassName,
|
||||
};
|
||||
this.setState(state);
|
||||
} catch (e) {
|
||||
@ -75,7 +79,15 @@ export default class DesignerPlugin extends PureComponent<PluginProps, DesignerP
|
||||
|
||||
render(): React.ReactNode {
|
||||
const { editor } = this.props;
|
||||
const { componentMetadatas, library, extraEnvironment, renderEnv, device, designMode } = this.state;
|
||||
const {
|
||||
componentMetadatas,
|
||||
library,
|
||||
extraEnvironment,
|
||||
renderEnv,
|
||||
device,
|
||||
designMode,
|
||||
deviceClassName,
|
||||
} = this.state;
|
||||
|
||||
if (!library || !componentMetadatas) {
|
||||
// TODO: use a Loading
|
||||
@ -95,6 +107,7 @@ export default class DesignerPlugin extends PureComponent<PluginProps, DesignerP
|
||||
renderEnv,
|
||||
device,
|
||||
designMode,
|
||||
deviceClassName,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
@ -54,5 +54,5 @@
|
||||
"publishConfig": {
|
||||
"registry": "http://registry.npm.alibaba-inc.com"
|
||||
},
|
||||
"homepage": "https://unpkg.alibaba-inc.com/@ali/lowcode-react-renderer@0.8.18/build/index.html"
|
||||
"homepage": "https:/unpkg.alibaba-inc.com/@ali/lowcode-react-renderer@0.8.18/build/index.html"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user