在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):adcentury/react-mobile-picker开源软件地址(OpenSource Url):https://github.com/adcentury/react-mobile-picker开源编程语言(OpenSource Language):JavaScript 84.4%开源软件介绍(OpenSource Introduction):React Mobile PickerReact Mobile Picker is a super simple component with no restriction, which means you can use it in any way you want. PreviewScan this Qr in you mobile. Or visit (in mobile or mobile simulator): http://adcentury.github.io/react-mobile-picker Install
UsageES6import Picker from 'react-mobile-picker'; CommonJSvar Picker = require('react-mobile-picker'); Props
Getting StartedBy design, React Mobile Picker is a Controlled Component, which means the selected value of the rendered element will always reflect the Here is an example of how to integrate React Mobile Picker: import React, {Component} from 'react';
import Picker from 'react-mobile-picker';
class App extends Component {
constructor(props) {
super(props);
this.state = {
valueGroups: {
title: 'Mr.',
firstName: 'Micheal',
secondName: 'Jordan'
},
optionGroups: {
title: ['Mr.', 'Mrs.', 'Ms.', 'Dr.'],
firstName: ['John', 'Micheal', 'Elizabeth'],
secondName: ['Lennon', 'Jackson', 'Jordan', 'Legend', 'Taylor']
}
};
}
// Update the value in response to user picking event
handleChange = (name, value) => {
this.setState(({valueGroups}) => ({
valueGroups: {
...valueGroups,
[name]: value
}
}));
};
render() {
const {optionGroups, valueGroups} = this.state;
return (
<Picker
optionGroups={optionGroups}
valueGroups={valueGroups}
onChange={this.handleChange} />
);
}
} More Examples
LicenseMIT. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论