-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.js
More file actions
45 lines (31 loc) · 1017 Bytes
/
Copy pathexample.js
File metadata and controls
45 lines (31 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* Created by chenyunjie on 2017/7/25.
*/
import React, {Component} from 'react';
import {View} from 'react-native';
import Select from '../src/index';
export default class SelectExample extends Component {
constructor(props) {
super(props);
this.mockData = [
{'name': '选项1', value: 1},
{'name': '选项2', value: 2},
{'name': '选项3', value: 3},
{'name': '选项4', value: 4},
{'name': '选项5', value: 5},
{'name': '选项6', value: 6},
{'name': '选项7', value: 7}
];
this.onSelectedChanged = this.onSelectedChanged.bind(this);
}
render() {
return (
<View style={{padding: 30}}>
<Select dataSource={this.mockData} labelField="name" type="radio" optionStateChange={this.onSelectedChanged}/>
</View>
);
}
onSelectedChanged(data) {
console.log('selected : ' + JSON.stringify(data));
}
}