Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
510dad58
A
ant-design
项目概览
wanjj_1210
/
ant-design
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ant-design
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
510dad58
编写于
6月 22, 2018
作者:
陈
陈帅
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
edit doc and dom
上级
1f25b104
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
43 addition
and
33 deletion
+43
-33
components/drawer/__tests__/Drawer.test.js
components/drawer/__tests__/Drawer.test.js
+2
-3
components/drawer/demo/basic.md
components/drawer/demo/basic.md
+3
-2
components/drawer/demo/from-drawer.md
components/drawer/demo/from-drawer.md
+6
-5
components/drawer/demo/user-profile.md
components/drawer/demo/user-profile.md
+32
-23
未找到文件。
components/drawer/__tests__/Drawer.test.js
浏览文件 @
510dad58
...
...
@@ -6,10 +6,9 @@ import Drawer from '..';
class
DrawerTester
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
visible
:
fals
e
};
this
.
state
=
{
visible
:
tru
e
};
}
componentDidMount
()
{
this
.
setState
({
visible
:
true
});
// eslint-disable-line react/no-did-mount-set-state
}
saveContainer
=
(
container
)
=>
{
this
.
container
=
container
;
...
...
@@ -34,7 +33,7 @@ class DrawerTester extends React.Component {
}
describe
(
'
Drawer
'
,
()
=>
{
it
(
'
render correctly
'
,
()
=>
{
f
it
(
'
render correctly
'
,
()
=>
{
const
wrapper
=
mount
(
<
DrawerTester
width
=
{
400
}
/>
)
;
const
content
=
wrapper
.
find
(
'
.ant-drawer-body
'
).
getDOMNode
().
innerHTML
;
expect
(
content
).
toBe
(
'
Here is content of Drawer
'
);
...
...
components/drawer/demo/basic.md
浏览文件 @
510dad58
---
order
:
0
title
:
zh-CN
:
基
本
zh-CN
:
基
础抽屉
en-US
:
Basic
---
## zh-CN
第一个抽屉。
基础抽屉,点击触发按钮抽屉从右滑出,点击遮罩区关闭
## en-US
...
...
@@ -37,6 +37,7 @@ class App extends React.Component {
<
Drawer
title
=
"Basic Drawer"
placement
=
"right"
closable
=
{
false
}
onClose
=
{
this
.
onClose
}
visible
=
{
this
.
state
.
visible
}
>
...
...
components/drawer/demo/from-drawer.md
浏览文件 @
510dad58
---
order
:
0
title
:
zh-CN
:
表单
抽屉
en-US
:
from
drawer
zh-CN
:
任务
抽屉
en-US
:
Task
drawer
---
## zh-CN
展示用户的详细信息
用于承载任务相关操作,需要点击关闭按钮关闭。
## en-US
Display user details
sed to carry tasks related operations, need to close by clicking the close button.
```
jsx
import
{
Drawer
,
Form
,
Button
,
Col
,
Row
,
Input
,
Select
,
DatePicker
}
from
'
antd
'
;
...
...
@@ -42,6 +42,7 @@ class App extends React.Component {
width
=
{
720
}
placement
=
"right"
onClose
=
{
this
.
onClose
}
maskClosable
=
{
false
}
visible
=
{
this
.
state
.
visible
}
>
<
Form
layout
=
"vertical"
hideRequiredMark
>
...
...
@@ -122,7 +123,7 @@ class App extends React.Component {
</
Row
>
<
Row
gutter
=
{
16
}
>
<
Col
span
=
{
24
}
>
<
Form
.
Item
label
=
"
d
escription"
>
<
Form
.
Item
label
=
"
D
escription"
>
{
getFieldDecorator
(
'
description
'
,
{
rules
:
[
{
...
...
components/drawer/demo/user-profile.md
浏览文件 @
510dad58
---
order
:
0
title
:
zh-CN
:
用户信息
en-US
:
User Profile
zh-CN
:
信息预览抽屉
en-US
:
Preview drawer
---
## zh-CN
展示用户的详细信息
用于信息预览的抽屉,点击遮罩区关闭。
-
需要快速预览对象概要时使用。如列表条目预览。
## en-US
Display user details
Drawer for information preview, click mask area off.
-
Use when you need to quickly preview the outline of the object. Such as list item preview.
```
jsx
import
{
Drawer
,
Divider
,
Button
,
Col
,
Row
}
from
'
antd
'
;
import
{
Drawer
,
List
,
Avatar
,
Divider
,
Col
,
Row
}
from
'
antd
'
;
const
pStyle
=
{
fontSize
:
16
,
...
...
@@ -63,23 +67,28 @@ class App extends React.Component {
render
()
{
return
(
<
div
>
<
Button
ghost
type
=
"primary"
onClick
=
{
this
.
showDrawer
}
style
=
{
{
height
:
80
,
width
:
80
,
}
}
>
<
img
src
=
"https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png"
width
=
{
32
}
alt
=
"logo"
/>
<
br
/>
<
span
>
Lily
</
span
>
</
Button
>
<
List
dataSource
=
{
[
{
name
:
'
Lily
'
,
},
{
name
:
'
Lily
'
,
},
]
}
bordered
renderItem
=
{
item
=>
(
<
List
.
Item
key
=
{
item
.
id
}
actions
=
{
[<
a
onClick
=
{
this
.
showDrawer
}
>
View Profile
</
a
>]
}
>
<
List
.
Item
.
Meta
avatar
=
{
<
Avatar
src
=
"https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png"
/>
}
title
=
{
item
.
name
}
description
=
"Progresser AFX"
/>
</
List
.
Item
>
)
}
/>
<
Drawer
width
=
{
640
}
placement
=
"right"
...
...
@@ -136,7 +145,7 @@ class App extends React.Component {
<
DescriptionItem
title
=
"Department"
content
=
"AFX"
/>
</
Col
>
<
Col
span
=
{
12
}
>
<
DescriptionItem
title
=
"Super
i
or"
content
=
{
<
a
>
Lin
</
a
>
}
/>
<
DescriptionItem
title
=
"Super
vis
or"
content
=
{
<
a
>
Lin
</
a
>
}
/>
</
Col
>
</
Row
>
<
Row
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录