1.0.5 • Published 7 years ago

react-native-dj-itemchoose v1.0.5

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

itemchoose

accordion

Install

npm i --save react-native-dj-itemchoose

Usage

Using in your app will usually look like this:

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

import ItemChooser from 'react-native-dj-itemchoose';

let data = [
{name:'1年',disabled:false},
{name:'2年',disabled:true},
{name:'3年',disabled:true}
];

export default class NPMTest extends Component {

    render() {
      let icons = [require('./images/success_black.png'), require('./images/error_black.png')];
      return (
        <View style={{marginTop:20}}>
          <ItemChooser selectedIndex={-1} dataList={data} icon={require('./NPM/react-native-dj-itemchoose/images/selected.png')} onChoose={(item, i)=>{console.log('choosed',item);}}/>
        </View>
      );
    }
}

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

Props

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

PropTypeOpt/RequiredDefaultNote
iconobjectOption| 选中行显示的icon,require('image!selected')/{uri:'selected.png'}
selectedIndexintOption0选中行的索引
dataListarrayRequired[]显示的数据
onChoosefunctionOption()=>{}选中后的行为,默认为选中后显示选中的图标,如有其它行为,可以加到这属性里

Methods

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

MethodParametersNote
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