-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve(ui): PageContainer style when first child is Tabs
- Loading branch information
1 parent
544df1f
commit 76a138e
Showing
3 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/** | ||
* iframe: 600 | ||
*/ | ||
import React, { useState } from 'react'; | ||
import { EllipsisOutlined } from '@oceanbase/icons'; | ||
import { Button, Descriptions, Dropdown, Input, Radio, Tabs, message } from '@oceanbase/design'; | ||
import { PageContainer } from '@oceanbase/ui'; | ||
|
||
export default () => { | ||
const [loading, setLoading] = useState(false); | ||
|
||
const mockRequest = () => { | ||
const promise = new Promise<void>(resolve => { | ||
setTimeout(() => { | ||
resolve(); | ||
}, 1000); | ||
}); | ||
setLoading(true); | ||
promise.then(() => { | ||
setLoading(false); | ||
message.success('刷新成功'); | ||
}); | ||
}; | ||
return ( | ||
<PageContainer | ||
ghost={false} | ||
loading={loading} | ||
header={{ | ||
title: '页面标题', | ||
reload: { | ||
spin: loading, | ||
onClick: () => { | ||
mockRequest(); | ||
}, | ||
}, | ||
breadcrumb: { | ||
items: [ | ||
{ | ||
href: '', | ||
title: '一级页面', | ||
}, | ||
{ | ||
href: '', | ||
title: '二级页面', | ||
}, | ||
{ | ||
title: '当前页面', | ||
}, | ||
], | ||
}, | ||
extra: [ | ||
<Button key="1">次要按钮</Button>, | ||
<Button key="2" type="primary"> | ||
主要按钮 | ||
</Button>, | ||
<Dropdown | ||
menu={{ | ||
items: [ | ||
{ | ||
label: '下拉菜单', | ||
key: '1', | ||
}, | ||
{ | ||
label: '下拉菜单2', | ||
key: '2', | ||
}, | ||
{ | ||
label: '下拉菜单3', | ||
key: '3', | ||
}, | ||
], | ||
}} | ||
> | ||
<Button key="3" style={{ padding: '0 8px' }}> | ||
<EllipsisOutlined /> | ||
</Button> | ||
</Dropdown>, | ||
], | ||
}} | ||
footer={[<Button>重置</Button>, <Button type="primary">提交</Button>]} | ||
> | ||
<Tabs | ||
items={[ | ||
{ | ||
key: '1', | ||
label: 'Tab 1', | ||
children: 'This is content of Tab 1', | ||
}, | ||
{ | ||
key: '2', | ||
label: 'Tab 2', | ||
children: 'This is content of Tab 2', | ||
}, | ||
]} | ||
tabBarExtraContent="This is tabBarExtraContent content" | ||
/> | ||
</PageContainer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters