mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-15 10:48:17 +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 SamplePreview = ({ editor }: PluginProps) => {
|
||||||
const [data, setData] = useState({});
|
const [data, setData] = useState({});
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const handleClick = async () => {
|
async function handleClick() {
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -25,6 +25,10 @@ const SamplePreview = ({ editor }: PluginProps) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function handleClose() {
|
||||||
|
setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
const { schema, components } = data;
|
const { schema, components } = data;
|
||||||
return (
|
return (
|
||||||
<div className="lowcode-plugin-sample-preview">
|
<div className="lowcode-plugin-sample-preview">
|
||||||
@ -34,11 +38,12 @@ const SamplePreview = ({ editor }: PluginProps) => {
|
|||||||
<Dialog
|
<Dialog
|
||||||
visible={visible}
|
visible={visible}
|
||||||
footer={false}
|
footer={false}
|
||||||
|
onClose={handleClose}
|
||||||
>
|
>
|
||||||
<ReactRenderer
|
{visible && <ReactRenderer
|
||||||
schema={schema}
|
schema={schema.componentsTree[0]}
|
||||||
components={components}
|
components={components}
|
||||||
/>
|
/>}
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user