mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-23 18:18:12 +00:00
1. ReactRender 使用了 shouldComponentUpdate ,不能继承自 PureComponent,改为继承 Component;
2. 预览样式修改;
This commit is contained in:
parent
a600cf4b37
commit
007f53435c
@ -1,3 +1,9 @@
|
|||||||
.lowcode-plugin-sample-preview {
|
.lowcode-plugin-sample-preview {
|
||||||
padding: 10px 4px;
|
padding: 10px 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.lowcode-plugin-sample-preview-content {
|
||||||
|
width: 80vw;
|
||||||
|
height: 80vh;
|
||||||
|
min-height: 300px;
|
||||||
|
}
|
||||||
@ -40,15 +40,10 @@ const SamplePreview = ({ editor }: PluginProps) => {
|
|||||||
<Button type="primary" onClick={handleClick}>
|
<Button type="primary" onClick={handleClick}>
|
||||||
预览
|
预览
|
||||||
</Button>
|
</Button>
|
||||||
<Dialog
|
<Dialog visible={visible} footer={false} onClose={handleClose}>
|
||||||
visible={visible}
|
{visible &&
|
||||||
footer={false}
|
<ReactRenderer className="lowcode-plugin-sample-preview-content" schema={schema} components={components} />
|
||||||
onClose={handleClose}
|
}
|
||||||
>
|
|
||||||
{visible && <ReactRenderer
|
|
||||||
schema={schema}
|
|
||||||
components={components}
|
|
||||||
/>}
|
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
"@ali/b3-one": "^0.0.17",
|
"@ali/b3-one": "^0.0.17",
|
||||||
"@ali/bzb-request": "^2.6.0-beta.13",
|
"@ali/bzb-request": "^2.6.0-beta.13",
|
||||||
"@ali/lib-mtop": "^2.5.1",
|
"@ali/lib-mtop": "^2.5.1",
|
||||||
"@alifd/next": "^1.18.17",
|
"@alifd/next": "^1.19.17",
|
||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
"events": "^3.0.0",
|
"events": "^3.0.0",
|
||||||
"fetch-jsonp": "^1.1.3",
|
"fetch-jsonp": "^1.1.3",
|
||||||
|
|||||||
4
packages/react-renderer/src/index.js
vendored
4
packages/react-renderer/src/index.js
vendored
@ -37,7 +37,7 @@ class FaultComponent extends PureComponent {
|
|||||||
class NotFoundComponent extends PureComponent {
|
class NotFoundComponent extends PureComponent {
|
||||||
render() {
|
render() {
|
||||||
console.error('component not found', this.props);
|
console.error('component not found', this.props);
|
||||||
return <Div {...this.props} />;
|
return <Div {...this.props} >{this.props.children || 'Component Not Found'}</Div>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ function isReactClass(obj) {
|
|||||||
return obj && obj.prototype && (obj.prototype.isReactComponent || obj.prototype instanceof Component);
|
return obj && obj.prototype && (obj.prototype.isReactComponent || obj.prototype instanceof Component);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Renderer extends PureComponent {
|
export default class Renderer extends Component {
|
||||||
static dislayName = 'renderer';
|
static dislayName = 'renderer';
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
appHelper: PropTypes.object,
|
appHelper: PropTypes.object,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user