mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-12 11:55:23 +08:00
30 lines
592 B
TypeScript
30 lines
592 B
TypeScript
|
import React, { useState } from 'react';
|
||
|
import { Button, Drawer } from 'antd';
|
||
|
|
||
|
const App: React.FC = () => {
|
||
|
const [open, setOpen] = useState(false);
|
||
|
|
||
|
const showDrawer = () => {
|
||
|
setOpen(true);
|
||
|
};
|
||
|
|
||
|
const onClose = () => {
|
||
|
setOpen(false);
|
||
|
};
|
||
|
|
||
|
return (
|
||
|
<>
|
||
|
<Button type="primary" onClick={showDrawer}>
|
||
|
Open
|
||
|
</Button>
|
||
|
<Drawer title="Basic Drawer" placement="right" onClose={onClose} open={open}>
|
||
|
<p>Some contents...</p>
|
||
|
<p>Some contents...</p>
|
||
|
<p>Some contents...</p>
|
||
|
</Drawer>
|
||
|
</>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default App;
|