mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
feat: Drawer support drawerRender (#49125)
* feat: Drawer support drawerRender * feat: add test
This commit is contained in:
parent
b4a98273fb
commit
a6bfb84993
@ -400,4 +400,15 @@ describe('Drawer', () => {
|
||||
expect(baseElement.querySelector('.custom-close')).not.toBeNull();
|
||||
expect(baseElement.querySelector('*[aria-label="Close"]')).not.toBeNull();
|
||||
});
|
||||
|
||||
it('drawerRender', () => {
|
||||
const { container } = render(
|
||||
<Drawer open getContainer={false} drawerRender={(dom) => <div id="test">{dom}</div>}>
|
||||
Here is content of Drawer
|
||||
</Drawer>,
|
||||
);
|
||||
|
||||
triggerMotion();
|
||||
expect(container.querySelector('#test')).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
@ -78,6 +78,7 @@ v5 use `rootClassName` & `rootStyle` to config wrapper style instead of `classNa
|
||||
| width | Width of the Drawer dialog | string \| number | 378 | |
|
||||
| zIndex | The `z-index` of the Drawer | number | 1000 | |
|
||||
| onClose | Specify a callback that will be called when a user clicks mask, close button or Cancel button | function(e) | - | |
|
||||
| drawerRender | Custom drawer content render | (node: ReactNode) => ReactNode | - | 5.19.0 |
|
||||
|
||||
## Semantic DOM
|
||||
|
||||
|
@ -77,6 +77,7 @@ v5 使用 `rootClassName` 与 `rootStyle` 来配置最外层元素样式。原 v
|
||||
| width | 宽度 | string \| number | 378 | |
|
||||
| zIndex | 设置 Drawer 的 `z-index` | number | 1000 | |
|
||||
| onClose | 点击遮罩层或左上角叉或取消按钮的回调 | function(e) | - | |
|
||||
| drawerRender | 自定义渲染抽屉 | (node: ReactNode) => ReactNode | - | 5.19.0 |
|
||||
|
||||
## Semantic DOM
|
||||
|
||||
|
@ -134,7 +134,7 @@
|
||||
"rc-checkbox": "~3.3.0",
|
||||
"rc-collapse": "~3.7.3",
|
||||
"rc-dialog": "~9.4.0",
|
||||
"rc-drawer": "~7.1.0",
|
||||
"rc-drawer": "~7.2.0",
|
||||
"rc-dropdown": "~4.2.0",
|
||||
"rc-field-form": "~2.2.0",
|
||||
"rc-image": "~7.8.0",
|
||||
|
Loading…
Reference in New Issue
Block a user