-
-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathtest-todo.tsx
More file actions
39 lines (35 loc) · 931 Bytes
/
test-todo.tsx
File metadata and controls
39 lines (35 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React from 'react';
import Drawer from './src/Drawer';
// 测试新的 size 属性
const TestNewSizeApi = () => {
return (
<div>
{/* 使用新的 size 属性 */}
<Drawer open={true} placement="right" size={400} getContainer={false}>
使用新的 size 属性
</Drawer>
{/* 使用新的 defaultSize 属性 */}
<Drawer
open={true}
placement="left"
defaultSize={300}
resizable={{
onResize: size => console.log('resized to:', size),
}}
getContainer={false}
>
使用新的 defaultSize 属性
</Drawer>
{/* 向后兼容:仍然支持 width/height */}
<Drawer
open={true}
placement="right"
width={350} // deprecated but still works
getContainer={false}
>
向后兼容 width 属性
</Drawer>
</div>
);
};
export default TestNewSizeApi;