diff --git a/components/Drawer/Drawer.js b/components/Drawer/Drawer.js index a784894..ae03a5c 100644 --- a/components/Drawer/Drawer.js +++ b/components/Drawer/Drawer.js @@ -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( drawer = v}> diff --git a/docs/cn/Drawer.md b/docs/cn/Drawer.md index 2f16d00..c6b3219 100644 --- a/docs/cn/Drawer.md +++ b/docs/cn/Drawer.md @@ -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) 中的同名函数。 参数说明:
- view: 抽屉内部视图内容
- side: 抽屉拉出边, 默认为 'left'
- rootTransform: 根组件转换动画, 默认为 'none'
- options: Drawer.DrawerView 其它属性, 参数类型参见 [DrawerView](#drawerdrawerview--props)
返回值为一个对象, 对象属性说明:
- key: 浮层唯一键值
- close: 关上抽屉函数, 调用该函数将关上抽屉 +| open | view, side, rootTransform options | object | 打开一个抽屉。 参数说明:
- view: 抽屉内部视图内容
- side: 抽屉拉出边, 默认为 'left'
- rootTransform: 根组件转换动画, 默认为 'none'
- options: Drawer.DrawerView 其它属性, 参数类型参见 [DrawerView](#drawerdrawerview--props)
返回值为一个对象, 对象属性说明:
- key: 浮层唯一键值
- close: 关上抽屉函数, 调用该函数将关上抽屉 ## Static Props | Prop | Type | Default | Note | diff --git a/example/views/DrawerExample.js b/example/views/DrawerExample.js index aa89ac0..824e529 100644 --- a/example/views/DrawerExample.js +++ b/example/views/DrawerExample.js @@ -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); } } diff --git a/package.json b/package.json index 33e802b..1b45bbc 100644 --- a/package.json +++ b/package.json @@ -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": {