rax-picker
TypeScript icon, indicating that this package has built-in type declarations

0.6.5 • Public • Published

Picker

npm

Picker is the basis of the drop-down selection box, call the system to select the original box

Install

$ npm install rax-picker --save

Import

import Picker from 'rax-picker';

Props

name type default describe
selectedValue String default selected value
onValueChange Function value change event

Options are defined using Picker.Item, Example:

<Picker.Item value={'somevalue'} />

Example

import {createElement, Component, render} from 'rax';
import View from 'rax-view';
import Text from 'rax-text';
import Picker from 'rax-picker';
 
class App extends Component {
  state = {
    selectedValue: ''
  };
  render() {
    return (
      <View style={{ width: 750 }}>
        <Text>选择性别</Text>
        <Picker 
          selectedValue={this.state.selectedValue}
          onValueChange={(value, index) => {
            this.setState({selectedValue: value});
          }}>
          <Picker.Item value={''} label={'男性'} />
          <Picker.Item value={''} label={'女性'} />
        </Picker>
      </View>
    );
  }
}
 
render(<App />);

Package Sidebar

Install

npm i rax-picker

Weekly Downloads

35

Version

0.6.5

License

BSD-3-Clause

Unpacked Size

273 kB

Total Files

14

Last publish

Collaborators

  • wintercn
  • yacheng
  • yuanyan
  • zeroling