mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
feat: 换种方式实现 loading 效果, 比之前出现的更早
This commit is contained in:
parent
f018e09868
commit
511b00f8f0
@ -90,19 +90,8 @@ export function createSimulator(
|
||||
<html class="engine-design-mode">
|
||||
<head><meta charset="utf-8"/>
|
||||
${styleFrags}
|
||||
<style>
|
||||
#engine-skeleton-wrapper {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 90vh;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<div id="engine-skeleton-wrapper"><img width="154" height="100" src="https://img.alicdn.com/tfs/TB1CmVgayERMeJjy0FcXXc7opXa-308-200.gif" /></div>
|
||||
</div>
|
||||
${scriptFrags}
|
||||
</body>
|
||||
</html>`);
|
||||
|
||||
@ -4,8 +4,26 @@ import { Designer } from '../designer';
|
||||
import { BuiltinSimulatorHostView } from '../builtin-simulator';
|
||||
import './project.less';
|
||||
|
||||
class Loading extends Component {
|
||||
render() {
|
||||
return (
|
||||
<div id="engine-loading-wrapper">
|
||||
<img width="154" height="100" src="https://img.alicdn.com/tfs/TB1CmVgayERMeJjy0FcXXc7opXa-308-200.gif" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@observer
|
||||
export class ProjectView extends Component<{ designer: Designer }> {
|
||||
componentDidMount() {
|
||||
const { designer } = this.props;
|
||||
const { project } = designer;
|
||||
|
||||
project.onRendererReady(() => {
|
||||
this.forceUpdate();
|
||||
});
|
||||
}
|
||||
render() {
|
||||
const { designer } = this.props;
|
||||
const { project } = designer;
|
||||
@ -15,6 +33,7 @@ export class ProjectView extends Component<{ designer: Designer }> {
|
||||
return (
|
||||
<div className="lc-project">
|
||||
<div className="lc-simulator-shell">
|
||||
{!project?.simulator?.renderer && <Loading />}
|
||||
<Simulator {...simulatorProps} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -18,3 +18,10 @@
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
#engine-loading-wrapper {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 90vh;
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { Component as ReactComponent, ComponentType } from 'react';
|
||||
import { ComponentMetadata, NodeSchema } from '@ali/lowcode-types';
|
||||
import { ISensor, Point, ScrollTarget, IScrollable, LocateEvent, LocationData } from './designer';
|
||||
import { BuiltinSimulatorRenderer } from './builtin-simulator/renderer';
|
||||
import { Node, ParentalNode } from './document';
|
||||
|
||||
export type AutoFit = '100%';
|
||||
@ -76,6 +77,7 @@ export interface ISimulatorHost<P = object> extends ISensor {
|
||||
readonly viewport: IViewport;
|
||||
readonly contentWindow?: Window;
|
||||
readonly contentDocument?: Document;
|
||||
readonly renderer?: BuiltinSimulatorRenderer;
|
||||
|
||||
// dependsAsset // like react jQuery lodash
|
||||
// themesAsset
|
||||
|
||||
@ -46,11 +46,11 @@ export interface EngineOptions {
|
||||
/**
|
||||
* 禁止默认的设置面板,默认值:false
|
||||
*/
|
||||
disableDefaultSettingPanel: boolean,
|
||||
disableDefaultSettingPanel: boolean;
|
||||
/**
|
||||
* 禁止默认的设置器,默认值:false
|
||||
*/
|
||||
disableDefaultSetters: boolean,
|
||||
disableDefaultSetters: boolean;
|
||||
/**
|
||||
* Vision-polyfill settings
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user