mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-12 17:08:14 +00:00
fix: schema should be componentsTree
This commit is contained in:
parent
9035a8554c
commit
69a2a8998f
@ -8,7 +8,7 @@ import './index.scss';
|
||||
const SamplePreview = ({ editor }: PluginProps) => {
|
||||
const [data, setData] = useState({});
|
||||
const [visible, setVisible] = useState(false);
|
||||
const handleClick = async () => {
|
||||
async function handleClick() {
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
@ -25,6 +25,10 @@ const SamplePreview = ({ editor }: PluginProps) => {
|
||||
}
|
||||
};
|
||||
|
||||
function handleClose() {
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
const { schema, components } = data;
|
||||
return (
|
||||
<div className="lowcode-plugin-sample-preview">
|
||||
@ -34,11 +38,12 @@ const SamplePreview = ({ editor }: PluginProps) => {
|
||||
<Dialog
|
||||
visible={visible}
|
||||
footer={false}
|
||||
onClose={handleClose}
|
||||
>
|
||||
<ReactRenderer
|
||||
schema={schema}
|
||||
{visible && <ReactRenderer
|
||||
schema={schema.componentsTree[0]}
|
||||
components={components}
|
||||
/>
|
||||
/>}
|
||||
</Dialog>
|
||||
</div>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user