Tip

继承自 Modal 组件,属于 Modal 系列。

Install

1. npm install beeshell

Usage

引入方式

全部引入

1. import { Tip } from 'beeshell';

单独引入

1. import Tip from 'beeshell/components/Modal/extensions/Tip';

Examples

image

Code

1. import { Tip } from 'beeshell';

3. class App extends React.Component {
4. render() {
5. <View>
6. <TouchableOpacity
7. onPress={() => {
8. this._tip.open();
9. }}>
10. <Text>基础用法</Text>
11. </TouchableOpacity>

13. <Tip
14. ref={(c) => { this._tip = c; }}
15. cancelable={true}
16. body="默认文案"
17. />
18. </View>
19. }
20. }

Props

Name Type Required Default Description
cancelable Boolean false true 点击蒙层是否消失
body String false ‘hello world’ 提示文案
alignItems String false ‘center’ 组件展示位置,flex-start 顶部 flex-end 底部 center 中部
duration Number false null 弹出后在 duration 指定的毫秒数后自动关闭,未指定则不会自动关闭

Methods

.open()

打开弹窗。

1. this._tip.open();

.close()

关闭弹窗。

1. this._tip.close();

其他

继承 Modal 组件的所有 Props、Methods。