1.0.8 • Published 7 years ago

react-native-dj-dialogwithcontent v1.0.8

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

DialogWithContent

accordion

Install

npm i --save react-native-dj-dialogwithcontent

Usage

Using in your app will usually look like this:

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';

import Dialog from 'react-native-dj-dialogwithcontent';

export default class NPMTest extends Component {

  testDialog(){
    this.refs.dialog.show("提示");

  }

  _renderDialogContent(){
      return(
          <View style={{height:60}}>
              <View>
                  <Text style={{fontSize: 14,color: "#333333",textAlign:'center'}}>删除后商品不能恢复</Text>
              </View>
              <View style={{height:10}}></View>
              <View>
                  <Text style={{fontSize: 14,color: "#333333",textAlign:'center'}}>是否确定删除?</Text>
              </View>
          </View>
      );
  }

  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome} onPress={this.testDialog.bind(this)}>
          TestDialogWithContent press me!
        </Text>
        <Dialog ref="dialog" callback={()=>{alert('I am deleted!')}}
           renderDialogContent={this._renderDialogContent.bind(this)}
           titleStyle={{fontSize: 16, color: "#333333", textAlign: 'center',lineHeight:20}}
           isRnNav='true'
            />
    </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
});

AppRegistry.registerComponent('NPMTest', () => NPMTest);

Props

The following props can be used to modify the style and/or behaviour:

PropTypeOpt/RequiredDefaultNote
isRnNavBooleanRequiredfalse是否正在使用RN导航,默认为false
titleStyleObjectOption{}标题样式
leftStyleObjectOption{}左边按钮样式
rightStyleObjectOption{}右边按钮样式
renderDialogContentfunctionRequired()=>{}Dialog内容渲染函数
callbackfunctionRequired()=>{}右边按钮点击回调函数

Methods

The following methods can be used to open and close the Dialog:

MethodParametersNote
showtitle: 标题、left:左边按钮文案、right:右边按钮文案调起控件.
1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago