From 69a2a8998f340d8568705262da79c6c865bd0dd5 Mon Sep 17 00:00:00 2001 From: "wuji.xwt" Date: Tue, 28 Jul 2020 14:21:27 +0800 Subject: [PATCH] fix: schema should be componentsTree --- packages/plugin-sample-preview/src/index.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/plugin-sample-preview/src/index.tsx b/packages/plugin-sample-preview/src/index.tsx index 3060b69d0..c6c6c38c5 100644 --- a/packages/plugin-sample-preview/src/index.tsx +++ b/packages/plugin-sample-preview/src/index.tsx @@ -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 (
@@ -34,11 +38,12 @@ const SamplePreview = ({ editor }: PluginProps) => { - + />}
);