From 6da37c650923137926aa02e9982d09b9375f314b Mon Sep 17 00:00:00 2001 From: chenos Date: Thu, 5 Aug 2021 18:53:44 +0800 Subject: [PATCH] hide the add new tab button when not designable --- packages/client/src/schemas/tabs/index.tsx | 125 +++++++++++---------- 1 file changed, 67 insertions(+), 58 deletions(-) diff --git a/packages/client/src/schemas/tabs/index.tsx b/packages/client/src/schemas/tabs/index.tsx index 3cdfc50ef..f9db03326 100644 --- a/packages/client/src/schemas/tabs/index.tsx +++ b/packages/client/src/schemas/tabs/index.tsx @@ -45,8 +45,15 @@ const useTabs = ({ singleton }) => { export const Tabs: any = observer((props: any) => { const { singleton, ...others } = props; - const { schema, DesignableBar, appendChild, root, remove, insertAfter } = - useDesignable(); + const { + designable, + schema, + DesignableBar, + appendChild, + root, + remove, + insertAfter, + } = useDesignable(); const tabs = useTabs({ singleton }); const [dragOverlayContent, setDragOverlayContent] = useState(''); @@ -97,65 +104,67 @@ export const Tabs: any = observer((props: any) => { {...others} className={cls({ singleton })} tabBarExtraContent={ - + }); + await createSchema(data); + }} + > + 新增标签页 + + ) } > {tabs.map(({ props, schema, name }, key) => (