Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
510add63
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,发现更多精彩内容 >>
提交
510add63
编写于
8月 05, 2018
作者:
A
afc163
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Drawer wrapClassName => className
上级
5cac2fab
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
7 deletion
+8
-7
components/drawer/index.en-US.md
components/drawer/index.en-US.md
+2
-2
components/drawer/index.tsx
components/drawer/index.tsx
+5
-4
components/drawer/index.zh-CN.md
components/drawer/index.zh-CN.md
+1
-1
未找到文件。
components/drawer/index.en-US.md
浏览文件 @
510add63
---
type
:
Feedback
category
:
Components
subtitle
:
subtitle
:
title
:
Drawer
---
...
...
@@ -27,7 +27,7 @@ A Drawer is a panel that is typically overlaid on top of a page and slides in fr
| title | The title for Drawer. | string
\|
ReactNode | - |
| visible | Whether the Drawer dialog is visible or not. | boolean | false |
| width | Width of the Drawer dialog. | string
\|
number | 256 |
|
wrapC
lassName | The class name of the container of the Drawer dialog. | string | - |
|
c
lassName | The class name of the container of the Drawer dialog. | string | - |
| zIndex | The
`z-index`
of the Drawer. | Number | 1000 |
| placement | The placement of the Drawer. | 'left'
\|
'right' | 'right'
| onClose | Specify a callback that will be called when a user clicks mask, close button or Cancel button. | function(e) | - |
components/drawer/index.tsx
浏览文件 @
510add63
...
...
@@ -2,6 +2,7 @@ import * as React from 'react';
import
RcDrawer
from
'
rc-drawer
'
;
import
PropTypes
from
'
prop-types
'
;
import
createReactContext
,
{
Context
}
from
'
create-react-context
'
;
import
warning
from
'
warning
'
;
import
classNames
from
'
classnames
'
;
const
DrawerContext
:
Context
<
Drawer
|
null
>
=
createReactContext
(
null
);
...
...
@@ -23,6 +24,7 @@ export interface DrawerProps {
title
?:
React
.
ReactNode
;
visible
?:
boolean
;
width
?:
number
|
string
;
/* deprecated, use className instead */
wrapClassName
?:
string
;
zIndex
?:
number
;
prefixCls
?:
string
;
...
...
@@ -53,7 +55,6 @@ export default class Drawer extends React.Component<DrawerProps, IDrawerState> {
title
:
PropTypes
.
node
,
visible
:
PropTypes
.
bool
,
width
:
PropTypes
.
oneOfType
([
PropTypes
.
string
,
PropTypes
.
number
]),
wrapClassName
:
PropTypes
.
string
,
zIndex
:
PropTypes
.
number
,
prefixCls
:
PropTypes
.
string
,
placement
:
PropTypes
.
string
,
...
...
@@ -178,7 +179,8 @@ export default class Drawer extends React.Component<DrawerProps, IDrawerState> {
);
}
renderProvider
=
(
value
:
Drawer
)
=>
{
let
{
zIndex
,
style
,
placement
,
className
,
...
rest
}
=
this
.
props
;
let
{
zIndex
,
style
,
placement
,
className
,
wrapClassName
,
...
rest
}
=
this
.
props
;
warning
(
wrapClassName
===
undefined
,
'
wrapClassName is deprecated, please use className instead.
'
);
const
RcDrawerStyle
=
this
.
state
.
push
?
{
zIndex
,
...
...
@@ -186,7 +188,6 @@ export default class Drawer extends React.Component<DrawerProps, IDrawerState> {
}
:
{
zIndex
};
this
.
praentDrawer
=
value
;
const
drawerClassNames
=
classNames
(
this
.
props
.
wrapClassName
,
className
);
return
(
<
DrawerContext
.
Provider
value
=
{
this
}
>
<
RcDrawer
...
...
@@ -197,7 +198,7 @@ export default class Drawer extends React.Component<DrawerProps, IDrawerState> {
showMask
=
{
this
.
props
.
mask
}
placement
=
{
placement
}
style
=
{
RcDrawerStyle
}
className
=
{
drawerClassNames
}
className
=
{
classNames
(
wrapClassName
,
className
)
}
>
{
this
.
renderBody
()
}
</
RcDrawer
>
...
...
components/drawer/index.zh-CN.md
浏览文件 @
510add63
...
...
@@ -28,7 +28,7 @@ title: Drawer
| title | 标题 | string
\|
ReactNode | - |
| visible | Drawer 是否可见 | boolean | - |
| width | 宽度 | string
\|
number | 256 |
|
wrapC
lassName | 对话框外层容器的类名 | string | - |
|
c
lassName | 对话框外层容器的类名 | string | - |
| zIndex | 设置 Drawer 的
`z-index`
| Number | 1000 |
| placement | 抽屉的方向 | 'left'
\|
'right' | 'right'
| onClose | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | 无 |
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录