2020-05-19 18:11:21 +08:00
|
|
|
---
|
|
|
|
order: 99
|
|
|
|
title:
|
|
|
|
zh-CN: 无遮罩
|
|
|
|
en-US: No mask
|
|
|
|
debug: true
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
通过 `mask={false}` 去掉遮罩。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
Remove mask.
|
|
|
|
|
|
|
|
```tsx
|
2022-05-23 14:37:16 +08:00
|
|
|
import { Button, Drawer } from 'antd';
|
2020-05-19 18:11:21 +08:00
|
|
|
import React, { useState } from 'react';
|
|
|
|
|
|
|
|
const App: React.FC = () => {
|
|
|
|
const [visible, setVisible] = useState(false);
|
2022-05-19 09:46:26 +08:00
|
|
|
|
2020-05-19 18:11:21 +08:00
|
|
|
const showDrawer = () => {
|
|
|
|
setVisible(true);
|
|
|
|
};
|
2022-05-19 09:46:26 +08:00
|
|
|
|
2020-05-19 18:11:21 +08:00
|
|
|
const onClose = () => {
|
|
|
|
setVisible(false);
|
|
|
|
};
|
2022-05-19 09:46:26 +08:00
|
|
|
|
2020-05-19 18:11:21 +08:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Button type="primary" onClick={showDrawer}>
|
|
|
|
Open
|
|
|
|
</Button>
|
|
|
|
<Drawer
|
|
|
|
title="Drawer without mask"
|
|
|
|
placement="right"
|
|
|
|
mask={false}
|
|
|
|
onClose={onClose}
|
|
|
|
visible={visible}
|
2022-07-27 23:44:45 +08:00
|
|
|
contentWrapperStyle={{
|
|
|
|
width: 333,
|
|
|
|
background: 'red',
|
|
|
|
borderRadius: 20,
|
|
|
|
boxShadow: '-5px 0 5px green',
|
|
|
|
overflow: 'hidden',
|
|
|
|
}}
|
2020-05-19 18:11:21 +08:00
|
|
|
>
|
|
|
|
<p>Some contents...</p>
|
|
|
|
<p>Some contents...</p>
|
|
|
|
<p>Some contents...</p>
|
|
|
|
</Drawer>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2022-04-15 16:20:56 +08:00
|
|
|
export default App;
|
2020-05-19 18:11:21 +08:00
|
|
|
```
|