Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-picker
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ym
react-native-picker
Commits
27175f04
Commit
27175f04
authored
Sep 20, 2016
by
xwenliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update readme
parent
2c9531fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
18 deletions
+19
-18
README.md
README.md
+1
-4
example/PickerTest/index.js
example/PickerTest/index.js
+18
-14
No files found.
README.md
View file @
27175f04
...
...
@@ -4,10 +4,7 @@
A Native Picker with high performance
####Demo
-
<b>
[
Date-picker
](
./demo/date-picker.js
)
</b>
-
<b>
[
Area-picker
](
./demo/area-picker.js
)
</b>
pure javascript version ->
[
v3.0.5
][
https://github.com/beefe/react-native-picker/tree/pure-javascript-version
]

...
...
example/PickerTest/index.js
View file @
27175f04
...
...
@@ -13,9 +13,9 @@ import {
import
Picker
from
'
react-native-picker
'
;
function
createDateData
(){
let
date
=
{}
;
let
date
=
[]
;
for
(
let
i
=
1950
;
i
<
2050
;
i
++
){
let
month
=
{}
;
let
month
=
[]
;
for
(
let
j
=
1
;
j
<
13
;
j
++
){
let
day
=
[];
if
(
j
===
2
){
...
...
@@ -33,9 +33,13 @@ function createDateData(){
day
.
push
(
k
+
'
日
'
);
}
}
month
[
j
+
'
月
'
]
=
day
;
let
_month
=
{};
_month
[
j
+
'
月
'
]
=
day
;
month
.
push
(
_month
);
}
date
[
i
+
'
年
'
]
=
month
;
let
_date
=
{};
_date
[
i
+
'
年
'
]
=
month
;
date
.
push
(
_date
);
}
return
date
;
};
...
...
@@ -43,18 +47,19 @@ function createDateData(){
function
createAreaData
(
callback
){
fetch
(
'
https://raw.githubusercontent.com/beefe/react-native-picker/master/example/PickerTest/area.json
'
).
then
(
res
=>
{
res
.
json
().
then
(
area
=>
{
let
data
=
{}
;
let
data
=
[]
;
let
len
=
area
.
length
;
for
(
let
i
=
0
;
i
<
len
;
i
++
){
let
city
=
area
[
i
][
'
city
'
];
let
cityLen
=
city
.
length
;
let
ProvinceName
=
area
[
i
][
'
name
'
];
data
[
ProvinceName
]
=
{};
for
(
let
j
=
0
;
j
<
cityLen
;
j
++
){
let
area
=
city
[
j
][
'
area
'
];
let
cityName
=
city
[
j
][
'
name
'
];
data
[
ProvinceName
][
cityName
]
=
area
;
let
city
=
[];
for
(
let
j
=
0
,
cityLen
=
area
[
i
][
'
city
'
].
length
;
j
<
cityLen
;
j
++
){
let
_city
=
{};
_city
[
area
[
i
][
'
city
'
][
j
][
'
name
'
]]
=
area
[
i
][
'
city
'
][
j
][
'
area
'
];
city
.
push
(
_city
);
}
let
_data
=
{};
_data
[
area
[
i
][
'
name
'
]]
=
city
;
data
.
push
(
_data
);
}
callback
(
data
);
});
...
...
@@ -70,7 +75,6 @@ export default class PickerTest extends Component {
}
_showDatePicker
()
{
Picker
.
hide
();
Picker
.
init
({
pickerData
:
createDateData
(),
selectedValue
:
[
'
2015年
'
,
'
12月
'
,
'
12日
'
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment