demo: improve drawer demo and test case code

pull/11472/merge
afc163 7 years ago
parent 1b3d063990
commit 76afe5037d

@ -40,7 +40,7 @@ class MultiDrawer extends React.Component {
</Button> </Button>
<Drawer <Drawer
title="Multi-level drawer" title="Multi-level drawer"
wrapClassName="test_drawer" className="test_drawer"
width={520} width={520}
closable={false} closable={false}
onClose={this.onClose} onClose={this.onClose}

@ -55,9 +55,3 @@ class App extends React.Component {
ReactDOM.render(<App />, mountNode); ReactDOM.render(<App />, mountNode);
``` ```
<style>
#_hj_feedback_container{
display:none
}
</style>

@ -55,10 +55,3 @@ class App extends React.Component {
ReactDOM.render(<App />, mountNode); ReactDOM.render(<App />, mountNode);
``` ```
<style>
#_hj_feedback_container{
display:none
}
</style>

@ -28,11 +28,9 @@ class DrawerForm extends React.Component {
}; };
onClose = () => { onClose = () => {
this.setState( this.setState({
{ visible: false,
visible: false, });
}
);
}; };
render() { render() {
@ -174,13 +172,8 @@ class DrawerForm extends React.Component {
); );
} }
} }
const App = Form.create()(DrawerForm); const App = Form.create()(DrawerForm);
ReactDOM.render(<App />, mountNode); ReactDOM.render(<App />, mountNode);
``` ```
<style>
#_hj_feedback_container{
display:none
}
</style>

@ -52,13 +52,12 @@ class App extends React.Component {
<Drawer <Drawer
title="Multi-level drawer" title="Multi-level drawer"
width={520} width={520}
wrapClassName="test_drawer"
closable={false} closable={false}
onClose={this.onClose} onClose={this.onClose}
visible={this.state.visible} visible={this.state.visible}
> >
<Button type="primary" onClick={this.showChildrenDrawer}> <Button type="primary" onClick={this.showChildrenDrawer}>
Two-level drawer Two-level drawer
</Button> </Button>
<Drawer <Drawer
title="Two-level Drawer" title="Two-level Drawer"
@ -102,9 +101,3 @@ class App extends React.Component {
ReactDOM.render(<App />, mountNode); ReactDOM.render(<App />, mountNode);
``` ```
<style>
#_hj_feedback_container{
display:none
}
</style>

@ -24,29 +24,27 @@ const pStyle = {
marginBottom: 16, marginBottom: 16,
}; };
const DescriptionItem = ({ title, content }) => { const DescriptionItem = ({ title, content }) => (
return ( <div
<div style={{
fontSize: 14,
lineHeight: '22px',
marginBottom: 7,
color: 'rgba(0,0,0,0.65)',
}}
>
<p
style={{ style={{
fontSize: 14, marginRight: 8,
lineHeight: '22px', display: 'inline-block',
marginBottom: 7, color: 'rgba(0,0,0,0.85)',
color: 'rgba(0,0,0,0.65)',
}} }}
> >
<p {title}:
style={{ </p>
marginRight: 8, {content}
display: 'inline-block', </div>
color: 'rgba(0,0,0,0.85)', );
}}
>
{title}:
</p>
{content}
</div>
);
};
class App extends React.Component { class App extends React.Component {
state = { visible: false }; state = { visible: false };
@ -185,9 +183,3 @@ class App extends React.Component {
ReactDOM.render(<App />, mountNode); ReactDOM.render(<App />, mountNode);
``` ```
<style>
#_hj_feedback_container{
display:none
}
</style>

@ -31,3 +31,9 @@ A Drawer is a panel that is typically overlaid on top of a page and slides in fr
| zIndex | The `z-index` of the Drawer. | Number | 1000 | | zIndex | The `z-index` of the Drawer. | Number | 1000 |
| placement | The placement of the Drawer. | 'left' \| 'right' | 'right' | placement | The placement of the Drawer. | 'left' \| 'right' | 'right'
| onClose | Specify a callback that will be called when a user clicks mask, close button or Cancel button. | function(e) | - | | onClose | Specify a callback that will be called when a user clicks mask, close button or Cancel button. | function(e) | - |
<style>
#_hj_feedback_container {
display: none;
}
</style>

@ -32,3 +32,9 @@ title: Drawer
| zIndex | 设置 Drawer 的 `z-index` | Number | 1000 | | zIndex | 设置 Drawer 的 `z-index` | Number | 1000 |
| placement | 抽屉的方向 | 'left' \| 'right' | 'right' | placement | 抽屉的方向 | 'left' \| 'right' | 'right'
| onClose | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | 无 | | onClose | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | 无 |
<style>
#_hj_feedback_container {
display: none;
}
</style>

Loading…
Cancel
Save