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) => {
|
||||
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,6 +104,7 @@ export const Tabs: any = observer((props: any) => {
|
||||
{...others}
|
||||
className={cls({ singleton })}
|
||||
tabBarExtraContent={
|
||||
designable && (
|
||||
<Button
|
||||
type={'dashed'}
|
||||
icon={<PlusOutlined />}
|
||||
@ -156,6 +164,7 @@ export const Tabs: any = observer((props: any) => {
|
||||
>
|
||||
新增标签页
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
>
|
||||
{tabs.map(({ props, schema, name }, key) => (
|
||||
|
Loading…
Reference in New Issue
Block a user