-
Notifications
You must be signed in to change notification settings - Fork 6.4k
/
picker.html
54 lines (53 loc) · 1.58 KB
/
picker.html
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
46
47
48
49
50
51
52
53
54
<div class="page">
<div class="page__hd">
<h1 class="page__title">Picker</h1>
<p class="page__desc">多列选择器,需要配合js实现</p>
</div>
<div class="page__bd page__bd_spacing">
<a href="javascript:" role="button" class="weui-btn weui-btn_default" id="showPicker">单列选择器</a>
<a href="javascript:" role="button" class="weui-btn weui-btn_default" id="showDatePicker">日期选择器</a>
</div>
</div>
<script type="text/javascript">
$('#showPicker').on('click', function () {
weui.picker([{
label: '飞机票',
value: 0
}, {
label: '火车票',
value: 1
}, {
label: '的士票',
value: 2
},{
label: '公交票 (disabled)',
disabled: true,
value: 3
}, {
label: '其他',
value: 4
}], {
onChange: function (result) {
console.log(result);
},
onConfirm: function (result) {
console.log(result);
},
title: '单列选择器',
showClose: false
});
});
$('#showDatePicker').on('click', function () {
weui.datePicker({
start: 1990,
end: new Date().getFullYear(),
onChange: function (result) {
console.log(result);
},
onConfirm: function (result) {
console.log(result);
},
title: '多列选择器'
});
});
</script>