Skip to content

Commit

Permalink
change Drawer.show to Drawer.open
Browse files Browse the repository at this point in the history
  • Loading branch information
rilyu committed May 21, 2017
1 parent 5f5d250 commit 8ebb949
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/Drawer/Drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class Drawer extends Overlay {

static DrawerView = Overlay.PullView;

static show(view, side = 'left', rootTransform = 'none', options = {}) {
static open(view, side = 'left', rootTransform = 'none', options = {}) {
let drawer;
let key = super.show(
<this.DrawerView side={side} rootTransform={rootTransform} {...options} ref={v => drawer = v}>
Expand Down
2 changes: 1 addition & 1 deletion docs/cn/Drawer.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Drawer 为抽屉静态类, 内部视图为 Overlay.PullView 的易用性简单
| Method | Params | Returns | Notes |
|---|---|---|---|
| [Overlay methods](./Overlay.md) | | | Drawer 继承 Overlay 的全部静态方法。
| show | view, side, rootTransform options | object | 显示一个抽屉, 重写 [Overlay{}](./Overlay.md) 中的同名函数。 参数说明:<br/>- view: 抽屉内部视图内容<br/>- side: 抽屉拉出边, 默认为 'left'<br/>- rootTransform: 根组件转换动画, 默认为 'none'<br/>- options: Drawer.DrawerView 其它属性, 参数类型参见 [DrawerView](#drawerdrawerview--props)<br/>返回值为一个对象, 对象属性说明:<br>- key: 浮层唯一键值<br/>- close: 关上抽屉函数, 调用该函数将关上抽屉
| open | view, side, rootTransform options | object | 打开一个抽屉。 参数说明:<br/>- view: 抽屉内部视图内容<br/>- side: 抽屉拉出边, 默认为 'left'<br/>- rootTransform: 根组件转换动画, 默认为 'none'<br/>- options: Drawer.DrawerView 其它属性, 参数类型参见 [DrawerView](#drawerdrawerview--props)<br/>返回值为一个对象, 对象属性说明:<br>- key: 浮层唯一键值<br/>- close: 关上抽屉函数, 调用该函数将关上抽屉

## Static Props
| Prop | Type | Default | Note |
Expand Down
4 changes: 2 additions & 2 deletions example/views/DrawerExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export default class DrawerExample extends NavigationPage {
show(side) {
let {rootTransform} = this.state;
if (side == 'left' || side == 'right') {
this.drawer = Drawer.show(this.renderDrawerMenu(), side, rootTransform);
this.drawer = Drawer.open(this.renderDrawerMenu(), side, rootTransform);
} else {
this.drawer = Drawer.show(this.renderDrawerBox(side), side, rootTransform);
this.drawer = Drawer.open(this.renderDrawerBox(side), side, rootTransform);
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teaset",
"version": "0.2.4",
"version": "0.2.5",
"description": "A UI library for react native.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 8ebb949

Please sign in to comment.