hide the add new tab button when not designable
This commit is contained in:
parent
8f746ae319
commit
6da37c6509
@ -45,8 +45,15 @@ const useTabs = ({ singleton }) => {
|
|||||||
|
|
||||||
export const Tabs: any = observer((props: any) => {
|
export const Tabs: any = observer((props: any) => {
|
||||||
const { singleton, ...others } = props;
|
const { singleton, ...others } = props;
|
||||||
const { schema, DesignableBar, appendChild, root, remove, insertAfter } =
|
const {
|
||||||
useDesignable();
|
designable,
|
||||||
|
schema,
|
||||||
|
DesignableBar,
|
||||||
|
appendChild,
|
||||||
|
root,
|
||||||
|
remove,
|
||||||
|
insertAfter,
|
||||||
|
} = useDesignable();
|
||||||
const tabs = useTabs({ singleton });
|
const tabs = useTabs({ singleton });
|
||||||
const [dragOverlayContent, setDragOverlayContent] = useState('');
|
const [dragOverlayContent, setDragOverlayContent] = useState('');
|
||||||
|
|
||||||
@ -97,6 +104,7 @@ export const Tabs: any = observer((props: any) => {
|
|||||||
{...others}
|
{...others}
|
||||||
className={cls({ singleton })}
|
className={cls({ singleton })}
|
||||||
tabBarExtraContent={
|
tabBarExtraContent={
|
||||||
|
designable && (
|
||||||
<Button
|
<Button
|
||||||
type={'dashed'}
|
type={'dashed'}
|
||||||
icon={<PlusOutlined />}
|
icon={<PlusOutlined />}
|
||||||
@ -156,6 +164,7 @@ export const Tabs: any = observer((props: any) => {
|
|||||||
>
|
>
|
||||||
新增标签页
|
新增标签页
|
||||||
</Button>
|
</Button>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{tabs.map(({ props, schema, name }, key) => (
|
{tabs.map(({ props, schema, name }, key) => (
|
||||||
|
Loading…
Reference in New Issue
Block a user