File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 33 <text class="example-info">可以同时选择日期和时间的选择器</text>
44 <uni-section :title="'日期用法:' + single" type="line"></uni-section>
55 <view class="example-body">
6- <uni-datetime-picker v-model="single " start="2021-3-20" end="2021-5-20" />
6+ <uni-datetime-picker type="date " start="2021-3-20" end="2021-5-20" @change="change " />
77 </view>
88 <uni-section :title="'时间戳用法:' + single" type="line"></uni-section>
99 <view class="example-body">
4646 single: '2021-04-3',
4747 'datetimesingle': '',
4848 range: ['2021-03-8', '2021-4-20'],
49- datetimerange: ['2021-03-20 20:10:10', '2021-05-10 10:10:10']
49+ datetimerange: ['2021-03-20 20:10:10', '2021-05-10 10:10:10'],
5050 }
5151 },
5252
5353 watch: {
54- single(newval) {
55- console.log('单选:', this.single);
56- },
5754 datetimesingle(newval) {
5855 console.log('单选:', this.datetimesingle);
5956 },
6360 datetimerange(newval) {
6461 console.log('范围选:', this.datetimerange);
6562 }
63+ },
64+
65+ methods:{
66+ change(e) {
67+ this.single = e
68+ console.log('----change事件:', this.single = e);
69+ }
6670 }
6771 }
6872</script>
Original file line number Diff line number Diff line change 33 <text class =" example-info" >可以同时选择日期和时间的选择器</text >
44 <uni-section :title =" '日期用法:' + single" type =" line" ></uni-section >
55 <view class =" example-body" >
6- <uni-datetime-picker v-model = " single " start =" 2021-3-20" end =" 2021-5-20" />
6+ <uni-datetime-picker type = " date " start =" 2021-3-20" end =" 2021-5-20" @change = " change " />
77 </view >
88 <uni-section :title =" '时间戳用法:' + single" type =" line" ></uni-section >
99 <view class =" example-body" >
4646 single: ' 2021-04-3' ,
4747 ' datetimesingle' : ' ' ,
4848 range: [' 2021-03-8' , ' 2021-4-20' ],
49- datetimerange: [' 2021-03-20 20:10:10' , ' 2021-05-10 10:10:10' ]
49+ datetimerange: [' 2021-03-20 20:10:10' , ' 2021-05-10 10:10:10' ],
5050 }
5151 },
5252
5353 watch: {
54- single (newval ) {
55- console .log (' 单选:' , this .single );
56- },
5754 datetimesingle (newval ) {
5855 console .log (' 单选:' , this .datetimesingle );
5956 },
6360 datetimerange (newval ) {
6461 console .log (' 范围选:' , this .datetimerange );
6562 }
63+ },
64+
65+ methods: {
66+ change (e ) {
67+ this .single = e
68+ console .log (' ----change事件:' , this .single = e);
69+ }
6670 }
6771 }
6872 </script >
You can’t perform that action at this time.
0 commit comments